JD> By the way SELECT uid, id, image, iname, quantity, type, user where it shows
JD> below that user isn't in the query- it is there in my editor.
>> $query = "SELECT uid, id, image, iname, quantity, type FROM 
>{$config["prefix"]}_shop WHERE  iname = $shopsearch";

The first problem would be that your search string needs to be enclosed
in quotes, preferably single, or at the very least escaped double
quotes.

Presumably, you want to find things that are inexact matches, but darn
close, and in that case you can use LIKE in your query.  Look in the
MySQL manual for the various permutations of LIKE clauses.

But fundamentally, you should to throw in an "or die(mysql_error())" in
conjunction with your mysql_query function.  IE:

$ret = mysql_query($query) or die(mysql_error());

This will tell you exactly the problem when executing a query. And as
others have said, another fine way to debug your queries is to simply
echo them to the screen, look at what is being sent to MySQL, and
trying it manually if the problem isn't glaringly obvious.

But first, surround your search term with quotes and see how far you
get.

- Julie

--> Julie Meloni
--> [EMAIL PROTECTED]
--> www.thickbook.com

Find "Sams Teach Yourself MySQL in 24 Hours" at
http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to