a conditionial insert

From: Date: Tue, 19 Nov 2002 02:51:05 +0000
Subject: a conditionial insert
Groups: php.general 
Request: Send a blank email to php-general+get-125019@lists.php.net to get a copy of this message
howdy have made up a script to insert stuff into my db but I want it to be conditionial as in I only want it inserterd if it matches the condition.. function new_user() { //check to see if the company is in the list $result = mysql_query("SELECT * FROM resellers WHERE company='$_POST[company]'"); // if it's not then ... if ($result == FALSE){ blah } //if it is then insert the rest of the stuff to the db else { $res = mysql_query(INSERT....) } but doing it this way doesn't seem to help.. any one got any idea's? I've had a look around and haven't been able to see a example like this... Cheers Peter "the only dumb question is the one that wasn't asked"

« previous php.general (#125019) next »