on 7/26/01 11:11 AM, Steve Fitzgerald ([EMAIL PROTECTED]) wrote:
> ran the query in the MySQL client and got the ERROR 1054: Unknown column
> '$ContactID' in 'where clause'. I know the column ContactID exists.
Of course it did. It can't find the text $ContactID in the table. Try
putting in a number (1,2,3, etc.) and see if it works.
If it does, try echo'ing out the $ContactID and the $sql to the screen. See
if $ContactID really is set and then try the output of $sql in the MySQL
client.
<?php
echo 'ContactID is: ' , $ContactID, '<br>';
$sql="SELECT * FROM contacts WHERE ContactID='$ContactID'";
echo 'SQL query is: ' , $sql, '<br>';
$result = mysql_query($sql,$db);
printf("%s\n", mysql_result($result,"FirstName"));
printf("%s<br>\n", mysql_result($result,"LastName"));
?>
Hope that helps.
Sincerely,
Paul Burney
+-------------------------+---------------------------------+
| Paul Burney | P: 310.825.8365 |
| Webmaster && Programmer | E: <[EMAIL PROTECTED]> |
| UCLA -> GSE&IS -> ETU | W: <http://www.gseis.ucla.edu/> |
+-------------------------+---------------------------------+
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]