[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-windows
Subject:    Re: [PHP-WIN] Problem with php and MySQL: inserting strings into
From:       Toby Hart Dyke <toby () hartdyke ! com>
Date:       2010-04-23 9:44:40
Message-ID: 4BD16C08.8080602 () hartdyke ! com
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic