Sorry, where it says echo $item should have read echo $line['item']; Simply
a typo, but the problem is still the same.
Hi,
I'm trying to do a search on database through a web interface using PHP and
having one small problem. Example: If I search for items that cost $5.00 and
there are three of them, the query works and displays the information, but
if there is only one item the query works but doesn't display the item. I
just get a blank page.
SELECT price, item FROM list WHERE price="$5.00";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo $item; }
If I do the same search from the MySQL command line the query will display
one or more items.
Ideas?
TIA
> >
> >
> > ---------------------------------------------------------------------
> > Before posting, please check:
> > http://www.mysql.com/manual.php (the manual)
> > http://lists.mysql.com/ (the list archive)
> >
> > To request this thread, e-mail <[EMAIL PROTECTED]>
> > To unsubscribe, e-mail <[EMAIL PROTECTED]>
> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> >
>
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php