Re: Problems when I insert a record into a mysql table...
| From: | Rick Emery | Date: | Thu, 17 Oct 2002 23:10:57 +0000 |
| Subject: | Re: Problems when I insert a record into a mysql table... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-120428@lists.php.net to get a copy of this message | ||
Correcting a typo:
altas="INSERT INTO ordenes
(orden,fecha,hora,Cliente,Contacto,domicilio,telefono) VALUES
(\"$orden\",\"$fecha\",\"$hora\",\"$Cliente\",\"$Contacto\",\"$domicilio\",\"$telefono\")";
----- Original Message -----
From: "Rick Emery" <remery@emeryloftus.com>
To: <php-general@lists.php.net>; <jalbores@maringuizar.com>
Sent: Thursday, October 17, 2002 6:08 PM
Subject: Fw: [PHP] Problems when I insert a record into a mysql table...
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