Whats wrong with this statement.

From: Philip J. Newman (NewmanPj_at_PhilipNZ.com)
Date: 12/14/03


To: <php-general@lists.php.net>
Date: Sun, 14 Dec 2003 12:13:41 +1300


<?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


Relevant Pages

  • Web Developers - Happy Hearts And HDTV! - Lockergnome
    ... Certificate on your MSIIS Web server. ... getting data from a database is only half the problem. ... Zend recently started a series about building rock solid code in PHP. ... which provides bulk database conversion. ...
    (freebsd-questions)
  • Re: Techniques for Vulneability discovery
    ... in mind) so i searched the net for some free database driven software and came ... the first thing i did was grab some info about PHP programming and some MySQL ... I did some more reasearch on different types of web based "input validation" ... PHP and SQL docs, etc.. ...
    (Vuln-Dev)
  • Re: Techniques for Vulneability discovery
    ... in mind) so i searched the net for some free database driven software and came ... the first thing i did was grab some info about PHP programming and some MySQL ... I did some more reasearch on different types of web based "input validation" ... PHP and SQL docs, etc.. ...
    (Security-Basics)
  • Re: CSS + xhtml static site - going dynamic?
    ... PHP then fills each content area. ... A better alternative is to have PHP pull the content off a database. ... management - menus and page linking need to be done by hand. ... So the second part is to formally build the linking structure into the ...
    (uk.net.web.authoring)
  • Re: CSS + xhtml static site - going dynamic?
    ... PHP then fills each content area. ... A better alternative is to have PHP pull the content off a database. ... management - menus and page linking need to be done by hand. ... So the second part is to formally build the linking structure into the ...
    (uk.net.web.authoring)