mysql query problem

From: Date: Thu, 26 Jul 2001 17:09:20 +0000
Subject: mysql query problem
Groups: php.db 
Request: Send a blank email to php-db+get-10803@lists.php.net to get a copy of this message
I'm trying to query my database to fill in data First Name Last Name. Using the script below I get (depending on the ContactID I enter) Contact: 1 1 or 2 2 If ContactID=0 I get Contact: Any ideas on what I am doing wrong? Thanks. Steve Fitzgerald <?php $sql="SELECT * FROM contacts WHERE ContactID='$ContactID'"; $result = mysql_query($sql,$db); printf("%s\n", mysql_result($result,"FirstName")); printf("%s<br>\n", mysql_result($result,"LastName")); ?>

« previous php.db (#10803) next »