Re: SQL / PHP Problem
| From: | (Richard Lynch) | Date: | Thu, 06 Jul 2000 00:22:36 +0000 |
| Subject: | Re: SQL / PHP Problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-5116@lists.php.net to get a copy of this message | ||
In article <39624D96.FC252B8@innovativeinternet.com>,
jack@innovativeinternet.com (Jack Sasportas) wrote:
What's $searchby?... You never print it out, and you have no
error-checking, so I suspect it's not what you think it is, and your
queries are breaking...
Use mysql_query($query) or die(mysql_error());
> <%
> $value_expanded=$value."%";
> if ($value == "") {
This looks pretty suspect... Are you sure it isn't supposed to be $loose
instead of $value? Otherwise, you'll be looking for stuff where $searchby
is ''...
Not the source of your real problem, however...
> $result = mysql_query("select * from numbers where
> $searchby='$value'");
>
> } else {
> $result = mysql_query("select * from numbers where $searchby like
> '$value_expanded'");
> }
> #echo "<tr>Value-".$value."-Value . . . .
> <BR>ValueEXP-".$value_expanded."-Value-Exp<BR></tr>";
> %>
>
> Thanks
>
> ___________________________________________________________
> Jack Sasportas
> Innovative Internet Solutions
> Phone 305.665.2500
> Fax 305.665.2551
> www.innovativeinternet.com
> www.web56.net
>
>
> --------------BFDDC931D0E4C8D171DF792C--
--
Richard Lynch | If this was worth $$$ to you, buy a CD
US Customer Support Director | from one of the artists listed here:
Zend Technologies USA | http://www.L-I-E.com/artists.htm
http://www.zend.com | (this has nothing to do with Zend,
duh!)