note 57488 added to function.mysql-query

From: Date: Wed, 05 Oct 2005 16:51:31 +0000
Subject: note 57488 added to function.mysql-query
Groups: php.notes 
Request: Send a blank email to php-notes+get-96448@lists.php.net to get a copy of this message
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. ---- Manual Page -- http://www.php.net/manual/en/function.mysql-query.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+57488 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57488&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57488&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57488&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57488&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57488&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57488&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57488&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+57488&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#96448) next »