Re: Insert problem
| From: | Alex Shi | Date: | Fri, 28 Sep 2001 23:17:08 +0000 |
| Subject: | Re: Insert problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-69232@lists.php.net to get a copy of this message | ||
Only one thing I could suggest: change all single quote to vars to
double quotes, and use backslash to escape, like this:
\"$id\",\"$username\", \"$naam\"
The reason to use double quotes is that the variable prefix '$' don't
work for single quote.
Hope this can help.
Alex
----- Original Message -----
From: "Martin Kampherbeek" <m.kampherbeek@home.nl>
To: <php-general@lists.php.net>
Sent: Friday, September 28, 2001 6:59 PM
Subject: [PHP] Insert problem
> I hope some some can help me.
>
> I made a form to put some data in a database.
> I the form I lmade a security so all fields are filled in.
> When I submit the form I get the data on my screen, but it will not be put
> in the database.
>
> To see the form check: http://www.martinkampherbeek.com/test.php}öq�Hë
> MÎç
8>®g
> To see the code, check the source.
>
> At submit, it will start adduser.php
> The insert line is this:
> mysql_connect(".....", ".....", ".....");
> mysql_select_db (...............);
>
> mysql_query ("INSERT INTO users (id, username, naam, adres, postcode,
> woonplaats, telefoonnummer, geboortedatum, emailadres, password)
> VALUES ('$id', '$username', '$naam',
> '$adres',
'$postcode',
> '$woonplaats', '$telefoonnummer', '$geboortedatum',
> '$emailadres',
> '$password')
> ");
>
> I hope someone can tell me why the data will not be put in my database.
>
> Cheers,
> Martin.
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>