Re: mysql_query problem

From: Date: Tue, 15 Apr 2003 18:36:59 +0000
Subject: Re: mysql_query problem
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-143882@lists.php.net to get a copy of this message
everythig works fine now... :( thanks.. thomas ----- Original Message ----- From: Alex Ciurea To: php mailing ; thomas Sent: Tuesday, April 15, 2003 1:29 AM Subject: Re: [PHP] mysql_query problem First of all, try to put a >>> break; <<< at the end of the >>> case <<< section: case "Adauga": Your code here break; case "Sterge": Your code here break; Good luck, Alex ----- Original Message ----- From: "thomas" <mtoma@mymail.ro> To: <php-general@lists.php.net> Sent: Tuesday, April 15, 2003 9:23 PM Subject: [PHP] mysql_query problem 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 ------------------------------------------------------------------------ http://felicitari.mymail.ro/

« previous php.general (#143882) next »