RE: [PHP-DB] The usual problem
| From: | Peter Lovatt | Date: | Mon, 03 May 2004 00:39:02 +0000 |
| Subject: | RE: [PHP-DB] The usual problem | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-34243@lists.php.net to get a copy of this message | ||
Looks OK to me
What error do you get ?
try
$sql = "
INSERT INTO underskrifter (
id
, type
, navn
, epost
, tid
, ip
, domain
, sted
) VALUES (
''
, '$_POST[type]'
, '$_POST[navn]'
, '$_POST[epost]'
, '$tid'
, '$ip'
, '$host'
, '$_POST[sted]'
);
";
mysql_query($sql) or die (mysql_error());
and see what you get
Peter
> -----Original Message-----
> From: Mathias Hunskår Furevik [mailto:mf@root.no]
> Sent: 03 May 2004 01:31
> To: php-db@lists.php.net
> Subject: [PHP-DB] The usual problem
>
>
> Whats worng with this?
>
> $sql = "INSERT INTO underskrifter (id, type, navn, epost, tid,
> ip, domain,
> sted) "
> . " VALUES ( '', '$_POST[type]', '$_POST[navn]',
> '$_POST[epost]',
> '$tid', '$ip', '$host', '$_POST[sted]' );"
> . " ";
>
> mysql_query($sql);
>
> ???
>
> First I tryed the usual INSERT syntax, then the one that phpMyAdmin
> suggests. None of them works.
>
> -
> Mathias
> Norway
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>