finding data
| From: | Hull, Douglas D | Date: | Thu, 15 Apr 2004 15:42:09 +0000 |
| Subject: | finding data | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-33907@lists.php.net to get a copy of this message | ||
I am trying to find data, or if not found set a variable to "Err". myvalue being a
variable in my database and $zchar being my value to find.
The following result is never 1 even if
no values were found, so the result is always 2. If the finding value does exist in my database
this does find the correct value:
if (!$result = mysql_query("SELECT * FROM bivalues WHERE
myvalue = '$zchar'"))
{
echo 'result 1 - not found';
$myresut =
"Err";
}
else
{
{echo 'result 2 - found it'
}
The following result is never 2
even if the value actually exist in my database, so the result is always 1:
if (!$result =
mysql_query("SELECT * FROM bivalues WHERE myvalue = $zchar"))
{
echo 'result 1 - not
found';
$myresult = "Err";
}
else
{
{echo 'result 2 - found it'
}
Thanks
for any help,
Doug