SQL / PHP Problem
| From: | Jack Sasportas | Date: | Tue, 04 Jul 2000 20:48:23 +0000 |
| Subject: | SQL / PHP Problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-4819@lists.php.net to get a copy of this message | ||
I have done this exactly the same way before, but somehow can't get
it
to work here. A search form passes value to the below script, we
then
add the % so we can get anything starting with the value as a
reslut...(
a% returns all matching a database entries)
I even echo'd the $value & $value_extended to see if something went
wrong, but everything is as expected, except the database returns
nothing unless we spell out the entire field value....
Any ideas on why this doesn;t work ?
<%
$value_expanded=$value."%";
if ($value == "") {
$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