note 57488 rejected from function.mysql-query by betz
| From: | betz@php.net | Date: | Wed, 05 Oct 2005 19:32:35 +0000 |
| Subject: | note 57488 rejected from function.mysql-query by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-96452@lists.php.net to get a copy of this message | ||
Note Submitter: sfowler39 at yahoo dot com
----
Can someone help me understand what I am doing wrong here in my code?
I am trying to make a form that if you put in a email address in the form and hit submit it will
either produce one of two things, say it exists im my database or you dont exist in my database. I
am missing something here and I cant find it.
// The form:
<form method="POST" action="custompage2.php">
Search Word: <input type="text" name="query">
<input type="SUBMIT" value="Search!">
</form>
<?php
include("db.php"); // gets the phpmaker db file
?>
<?
// PHP Search Script
$conn = phpmkr_db_connect(HOST, USER, PASS, DB, PORT);
$sql = mysql_query("SELECT address FROM web2") or die (mysql_error());//looks in the db
for the email address
while(list($address)=mysql_fetch_array($sql)){
if ( $address == $sql ) {
echo "Your in the database";
} else {
echo "Your not in the database";
}
}
?>
Thank you.