Re: search
| From: | rija | Date: | Fri, 01 Nov 2002 22:25:49 +0000 |
| Subject: | Re: search | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-122468@lists.php.net to get a copy of this message | ||
Perhaps the table name 'desc' is reserved word for 'order by' so MySQL
cannot use it as table name-
So why don't you print out the mysql_error() using for example die-
like this:
$inquiry = mysql_query("select id,link,heading,desc from links where heading
like '%$entry%' or desc like '%$entry%' or keyword like
'%$entry%'",$connection)) or die (mysql_error()) ;
----- Original Message -----
From: "samug" <samug@vectorstar.net>
To: <php-general@lists.php.net>
Sent: Saturday, November 02, 2002 3:39 AM
Subject: [PHP] search
> There's no php.sql, so I'll put it here.
>
> I'm trying to do a search from mysql database like this:
>
> if (!$inquiry = mysql_query("select id,link,heading,desc from links where
> heading like '%$entry%' or desc like '%$entry%'
> or keyword like '%$entry%'",$connection)){
> print "<LI>Search was unsuccesful!";
> }
> else{
> while ($link = mysql_fetch_row($inquiry)){
> print "<LI><A HREF=\"" . $link[1];
> print "\">" . $link[2];
> print "</A> <I>" . $link[3] . "</I>" ;
> }
>
> }
>
> But everytime I get all the possible entries, even though I'm sure it
> doesn't match.
>
> Thanks for your answers.
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>