PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I'm a newbie trying to make a search engine, but after I submit the form it says that there is something wrong with line 47, could anyone help me with this please
This is line 47: while ($row = mysql_fetch_object ($query_result))
it says nothing, but it dos not find any records either, even I know they are there.
When I'm searching for Monkey with the category Games, it comes up with nothing, but Monkey (island) is recorded in the database.
I'm *guessing* that your problem is with your MySQL query. I suggest that you try running the query on your database from the command prompt to see if there might be something wrong with it. Also, check out the use of mysql_error() to see if maybe your query is returning an error and thats why its not working. Hope that helps.
thanks, it works now, it was my sql query. I just had to remove the ORDER BY then it worked but how can I order the results if the this made the error ?
SELECT * FROM cd, sw, cat
WHERE (sw.sw_title like "$search%")
AND (sw.cat_id = "$cat" )
AND (sw.cd_id = cd.cd_id) ORDER BY (sw.sw_title "$radDirection")
But this query didnt work until I removed ORDER BY at the end.
Have you tried removing the parenthesis from around the ORDER BY clause?
You also don't need to have lots of escaped double quotes in your SQL statement (in fact in SQL you shouldn't really have double quotes) because you can (and should) use single quotes instead: