Re: Query problem

From: Date: Tue, 12 Nov 2002 22:29:28 +0000
Subject: Re: Query problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-124081@lists.php.net to get a copy of this message
$query = "INSERT INTO mararegistro (visitorid, fname, lname, borndate, address, city, country, phone, how) VALUES (null, 'c', 'c', '12', 'c', 'c', 'c', '12', 'c')"; I think you should put quotes around all of these values 12 exept null or change null to '' /// ----- Original Message ----- From: "Cesar Aracena" <icaam@icaam.com.ar> To: "PHP General" <php-general@lists.php.net> Sent: Wednesday, November 13, 2002 8:27 AM Subject: [PHP] Query problem > Hi all, > > I came back from vacations and forgot some things about queries... can > anyone tell me what is wrong with this? of all the error messages I set up > in the script, none comes back on the page but the record is not saved... > > <? > > $db = mysql_connect("www.icaam.com.ar", "icaam", "********"); > if (!$db) > { > die("No se pudo abrir la base de datos"); > } > > $ok = mysql_select_db("icaam"); > if(!$ok) > { > die("No se pudo acceder a la base de datos"); > } > > $borndate = $bornd . $bornm . $borny; > $phonenumber = $phone; > > $query = "INSERT INTO mararegistro (visitorid, fname, lname, borndate, > address, city, country, phone, how) VALUES (null, 'c', 'c', 12, > 'c', 'c', > 'c', 12, 'c')"; > $result = mysql_query($query) or die (mysql_errno()); > if (mysql_affected_rows() != 1) > { > die("Fallo al guardar datos"); > } > > echo "Gracias por administrarnos su información."; > > ?> > > Any thiughts? Thanks in advance, > > Cesar > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#124081) next »