>From what I can see, you are not defining the array $row in here. You would need to define something like:
$row=mysql_fetch_array($ret); before calling it. I finally found where the information on LIKE is in the manual (I can understand your frustration, it took me a while). It is under Pattern Matching if you search the manual. HTH Maureen Jennifer Downey <[EMAIL PROTECTED]> said: > Thanks Maureen, > > I don't get the errors I was getting so that shows me you are great. Now my > next problem is if an item is found how do I echo or print that to the > screen. I have this as a starting point but I don't know where to go after > this. > > if($search) > { > $query = "SELECT uid, id, image, iname, quantity, user, type FROM > {$config["prefix"]}_shop WHERE iname LIKE '%$searchword%' ORDER BY iname"; > $ret = mysql_query($query) or die(mysql_error()); > while(list($iname)=mysql_fetch_row($ret)) > > $user = $row['user']; > if($iname == $searchword) echo $user; > > }else{ > > echo "<FORM METHOD=post ACTION='$PHP_SELF'>"; > echo "Search Shops<BR><input type=text name=\"searchword\" value=\"\">"; > echo "<BR><INPUT TYPE='submit' NAME='search' VALUE='Search'>"; > > } > I can't get any data to show up. > > Could you shed some light on this. I don't want you to wirte it just let me > know if I am on the righ track. > > Thanks > Jennifer > > > "Maureen" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > The query should read as below, without the = after the LIKE: > > > > $query = "SELECT uid, id, image, iname, quantity, type FROM > > {$config["prefix"]}_shop WHERE iname LIKE '%$shopsearch% ORDER BY > > iname'"; > > > > HTH > > > > Maureen > > > > > > Jennifer Downey <[EMAIL PROTECTED]> said: > > > > > Hi all, > > > > > > I have been trying to build a search script for my site that deals with > only > > > one table in my db. > > > As Julie Meloni pointed out look in the MySQL manual for LIKE clauses I > > > can't seem to locate that clause in ether > > > manual. > > > Dan Brunner gave me this to go on: > > > > > > $query = "SELECT uid, id, image, iname, quantity, type FROM > > > {$config["prefix"]}_shop WHERE iname LIKE = '%$shopsearch% ORDER BY > > > iname'"; > > > $ret = mysql_query($query); > > > while(list($quantity)=mysql_fetch_row($ret)) > > > > > > But I can't seem to get this to work. I have never worked with LIKE > before > > > and would appreciate any help on this. > > > > > > Thanks Julie and Dan for your time and effort. > > > > > > Thanks all for your time and help > > > Jennifer > > > > > > > > > -- > > > The sleeper has awaken > > > > > > > > > --- > > > Outgoing mail is certified Virus Free. > > > Checked by AVG anti-virus system (http://www.grisoft.com). > > > Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 > > > > > > > > > > > > -- > > > PHP Database Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > -- > > > > > > > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php