Re: Problem with php and MySQL: inserting strings into database

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Apart from Warren's excellent advice, the source of your problem is things like this:

'$_POST['vorname']'

How is PHP supposed to know that this is nested parentheses? You should have done it like this:

"$_POST['vorname']"

Though of course, follow Warren's advice, and don't do it like this at all ;-)

  Toby

On 4/23/2010 6:34 AM, Alexander Schunk wrote:
Hello,

i have a problem with php and mysql when inserting strings into a database.

I have the following syntax:

$sqlinsert = "INSERT INTO werte ('benutzername', 'passwort', 'name',
'vorname', 'Geburtsdatum', 'strasse', 'plz', 'ort', 'email')
VALUES('$_POST['benutzername']', '$_POST['passwort']',
'$_POST['name']', '$_POST['vorname']', '$_POST['Geburtsdatum']',
'$_POST['straße']', '$_POST['plz']', '$_POST['ort']',
'$_POST['email']')";

I am getting an unexpected T_STRING ....  error.



--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux