Re: Insert problems in to a MySQL database.
| From: | Jerry | Date: | Thu, 05 Oct 2000 15:42:01 +0000 |
| Subject: | Re: Insert problems in to a MySQL database. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-18740@lists.php.net to get a copy of this message | ||
In article <001101c02ee0$98e3ecc0$0500a8c0@federation.se>,
jari.ivanoff@telia.com ("Jari Ivanoff") wrote:
> mysql_query("insert into news.news
> values(NULL,curdate(),curtime(),'$rubrik','$content';") or
> die("Invalid
> Query");
>
> With and without the ' signs and the ; signs in different places.
> Any ideas? ;-)
Try:
$query = "insert into news.news
values(NULL,curdate(),curtime(),'$rubrik','$content')";
if (mysql_query($query) {
echo "<p>Query successful.</p>\n";
} else {
echo "<p>Query '$query' unsuccessful: ", mysql_error(),
"</p>\n";
}
This should tell you what's going wrong, and what the actual query is so
you can try it in your sql client.
Jerry