|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
PHP/MySQL Search Tutorial
Hi there,
I have been working through this article on PHP/MySQL Search at DevArticles. http://www.devarticles.com/content....cleId=79&page=1 I have worked through the tutorial and haven't received any errors at all from either MySQL or PHP. However, when I reached the end of the tutorial and type in 'MySQL' it only brings back one result even though it should be two. If I enter 'MySQL Apache', it still only brings back one result, when it should be three. I haven't altered the scripts in any way at all, as I am a real newbie. Please can anyone help me, Thanks |
|
#2
|
|||
|
|||
|
Hi Fumi,
Did you create all of the required rows in the MySQL table? What I would suggest is taking the MySQL queries from the PHP script and run them against the database using the MySQL console application if you can, this way you can see if its the queries or the script that isn't working. That tutorial was written a while back and as such was written for PHP 4.1. Which version of PHP are you using? If it's 4.2 then you may need to change some of the globally dependant variable declerations, etc. |
|
#3
|
|||
|
|||
|
Checked tables
I did check these sql tables. As I have been trying this script, I believe the PHP is at fault somehow. No matter how many keywords or articles I add, the script will only ever bring back the last one.
I.e, if I insert 'MySQl' 1,2,3 (indicating that 'MySQL' is available in three articles) then the script will only bring back article three etc. If I run update so that it reads ( 'MySQL' 1,2 ), then keying in MySQL will only bring back article two. The constant factor is that the script only seems to want to bring back one result and that result is always the last one. I am running PHP 4.2.1 Fumi |
|
#4
|
|||
|
|||
|
Problem solved
Somebody found a solution for me.
PHP: ------------------------------------------------------------------------ $articles*=*array_unique($articles); ------------------------------------------------------------------------ This was wiping the other entries that was being stored. Thanks again, Fumi |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > PHP/MySQL Search Tutorial |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|