php-general | 2003022
Date: 02/25/03
- Next message: John W. Holmes: "RE: [PHP] $_POST arrays not evaluated in sql statement -- why?"
- Previous message: Richard Whitney: "Re: [PHP] mysql trouble"
- In reply to: Luis A: "[PHP] mysql trouble"
- Next in thread: Luis A: "[PHP] to holmes Re: [PHP] mysql trouble"
- Reply: Luis A: "[PHP] to holmes Re: [PHP] mysql trouble"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> take a look at this
> <?php
> // process form
> $link = mysql_connect("localhost", "root");
> mysql_select_db("mydb",$db);
> $sql = "INSERT INTO agenda (nombre, direccion, telefono, email) " +
> "VALUES ('$nombre', '$direccion', '$telefono', '$email')";
> $result = mysql_query($sql);
You use a period (.) to concatenate strings, not a plus (+) symbol.
If you displayed $sql, like you should when you're debugging your
script, you'd of realized this a long time ago.
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: John W. Holmes: "RE: [PHP] $_POST arrays not evaluated in sql statement -- why?"
- Previous message: Richard Whitney: "Re: [PHP] mysql trouble"
- In reply to: Luis A: "[PHP] mysql trouble"
- Next in thread: Luis A: "[PHP] to holmes Re: [PHP] mysql trouble"
- Reply: Luis A: "[PHP] to holmes Re: [PHP] mysql trouble"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

