RE: [PHP-DB] Variables in MySQL Insert Queries
| From: | KSchneider | Date: | Fri, 24 Aug 2001 16:33:41 +0000 |
| Subject: | RE: [PHP-DB] Variables in MySQL Insert Queries | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-11809@lists.php.net to get a copy of this message | ||
plague --
unfortunately i don't have the beginnings of this thread, but if your code
below is verbatim, it looks as though you are missing the mysql_query()
statement. that should drop your information.
kate
> -----Original Message-----
> From: plague [mailto:plague@freeze.com]
> Sent: Friday, August 24, 2001 12:57 AM
> To: php-db@lists.php.net
> Subject: [PHP-DB] Variables in MySQL Insert Queries
>
>
> I am using this code to connect to my database and insert form data from
> a
> user:
>
> $connect = mysql_connect("myhost","user","pass") or die ("
> not
> connected");
> @mysql_select_db("dbname");
> $sql="INSERT INTO tablename
> (id,first,last,age,email,sfuser,sfship,icq,ac,loca,ref)
>
> Values(,
$first,$last,'$age',&côµïž
> {€ô„$email,$sfuser,$sfship,$icq,$ac,`$
> loca,$ref`)";
> echo (mysql_affected_rows()?"success":"failure");
> mysql_close($connect);
>
> The script returns "success" except for it doesn't insert the data (
> from a
> form ).
>
> The age column is BLOB, not INT.
>
> I would really appreciate the help of someone, as this has really
> stumped
> me.
>
> Thanks,
>
> plague
>
>
>