mysql_query problem

From: Date: Tue, 15 Apr 2003 18:23:55 +0000
Subject: mysql_query problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-143879@lists.php.net to get a copy of this message
hi all I have this code: switch ($_POST['Submit']) { case 'Adauga': if (!empty($_POST['address']) and !empty($_POST['goto'])) { echo $sql = "insert into postfixdb.virtual values('".$_POST['address']."','".$_POST['goto']."')"; if(($res=mysql_query($sql))<=0) echo mysql_error(); echo "<br>res:".$res; echo "<br>aff: ".mysql_affected_rows (); } case 'Sterge': if (!empty($_POST['address']) and !empty($_POST['goto'])) { $sql = "delete from postfixdb.virtual where address = '".$_POST['address']."' and goto ='".$_POST['goto']."'"; mysql_query($sql); } } when $_POST['Submit']=='Sterge' everything works fine when $_POST['Submit']=='Adauga' => res: 1; aff: 1; no mysqlerror but in mysql the new row isn't apear I copy the result of $sql and I paste this directly in mysql and the new row inserted.... what happening? Apache/1.3.27 Mysql 3.23.53a PHP 4.3.2RC1 redhat 8.0

« previous php.general (#143879) next »