Whats wrong with this statement.
| From: | Philip J. Newman | Date: | Sat, 13 Dec 2003 23:13:41 +0000 |
| Subject: | Whats wrong with this statement. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-172655@lists.php.net to get a copy of this message | ||
<?php
## ASSUME DATABASE IS CONNECTED AND THESE 2 ITEMS ARE NOT IN THE DATABASE
## THIS RETURNS 1,0 all the time.
$websiteUrl="http://www.philipnz.com/";
$websiteEmail="newmanpj@philipnz.com";
// CHECK TO SEE IF DATA MATCHS WHATS IN THE DATABASE.
$sql = "SELECT hUrl,hContactEmail FROM hyperlinks_data";
$sql_result = mysql_query($sql, $connection) or die ("Could not get Query");
$exists_hUrl = "0";
$exists_hContactEmail = "0";
while ($row = mysql_fetch_array($sql_result)) {
if ($websiteUrl==$row["hUrl"]) { $exists_hUrl = "1"; break; }
if ($websiteEmail==$row["hContactEmail"]) { $exists_hContactEmail = "1";
break; }
}
Echo" $exists_hUrl, $exists_hContactEmail";
?>
---
Philip J. Newman
Master Developer
PhilipNZ.com [NZ] Ltd.
info@PhilipNZ.com