Hello!!
Use LIKE in your WHERE clause...
You can also more then when Field....
Example.....
$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))
Dan
On Wednesday, April 24, 2002, at 01:47 PM, [EMAIL PROTECTED] wrote:
> By the way SELECT uid, id, image, iname, quantity, type, user where it
> shows
> below that user isn't in the query- it is there in my editor.
> I just forgot to put it in before sending.
> Jennifer
> "Jennifer Downey" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>> This is basically what I am trying to do
>> if($search)
>> {
>> $query = "SELECT uid, id, image, iname, quantity, type FROM
>> {$config["prefix"]}_shop WHERE iname = $shopsearch";
>> $ret = mysql_query($query);
>> while(list($quantity)=mysql_fetch_row($ret))
>>
>> $name = $row['user'];
>> echo $name;
>>
>> }else{
>>
>> echo "<FORM METHOD=post ACTION='$PHP_SELF'>";
>> echo "Search Shops<BR><input type=text name=\"shopsearch\"
>> value=\"\">";
>> echo "<BR><INPUT TYPE='submit' NAME='search' VALUE='Search'>";
>>
>> }
>>
>> This is a dump of the table
>>
>> uid int(10) NOT NULL default '0',
>> id int(5) NOT NULL default '0',
>> iname varchar(50) NOT NULL default '',
>> image varchar(100) NOT NULL default '',
>> quantity int(10) unsigned NOT NULL default '1',
>> type varchar(20) NOT NULL default '',
>> price int(6) NOT NULL default '0',
>> user varchar(50) NOT NULL default '',
>> KEY uid (uid)
>>
>> Just a note this works throughout my site and I have no trouble with
>> it:
>> {$config["prefix"]}_shop
>> I'm not trying to be rude but I get sick of it when people tell me that
> this
>> is the problem when it has nothing to do with the question I am asking.
>>
>> Thanks for your time and help
>> Jennifer
>>
>> "Julie Meloni" <[EMAIL PROTECTED]> wrote in message
>> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>>>
>>> JD> Would someone kindly point me to a tutorial on designing a search
>> script for
>>> JD> mysql db.
>>> JD> I have tried to build one but can't get anywhere with it.
>>>
>>> Well, that would depend on what and how you are searching, your table
>>> structure, etc. Essentially, every SELECT query is a "search".
>>>
>>> If you post more information about your table(s) structure, your
>>> search methods and the search parameters, people would probably be
>>> able to help you.
>>>
>>>
>>> - 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
>>>
>>
>>
>> ---
>> 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
>>
>>
>
>
> ---
> 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