Fw: [PHP] Problems when I insert a record into a mysql table...
| From: | Rick Emery | Date: | Thu, 17 Oct 2002 23:08:08 +0000 |
| Subject: | Fw: [PHP] Problems when I insert a record into a mysql table... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-120427@lists.php.net to get a copy of this message | ||
Each value which contains alpha characters must be surrounded with quotes:
$altas="INSERT INTO ordenes
(orden,fecha,hora,Cliente,Contacto,domicilio,telefono) VALUES
(\"$orden\",\"$fecha\",\"$hora\",\"$Cliente\",\"$Contacto\",\"$domicilio\",\"$telefono)\"";
Otherwise, mysql will reject it.
I recommend the following to show the error:
$resultado = mysql_query($altas) or die("Error:
<BR>$altas<BR>".mysql_error());
---- Original Message -----
From: "Jorge Albores" <jalbores@maringuizar.com>
To: <php-general@lists.php.net>
Sent: Thursday, October 17, 2002 5:55 PM
Subject: [PHP] Problems when I insert a record into a mysql table...
Hi all,
I have some troubles when I try to insert a new record into a mysql table
I'm learning PHP, I live in Mexico.
This is the fragment of the program...
$altas="INSERT INTO ordenes
(orden,fecha,hora,Cliente,Contacto,domicilio,telefono) VALUES
($orden,$fecha,$hora,$Cliente,$Contacto,$domicilio,$telefono)";
$resultado = mysql_query($altas);
Please someone help me....
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php