Confused about what seems a simple query

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
mhouldridge
Forum Contributor
Posts: 267
Joined: Wed Jan 26, 2005 5:13 am

Confused about what seems a simple query

Post by mhouldridge »

Hi,

I am trying to insert a new record into my database with a simple query. I have echoed it within my code, and everything appears fine. Here is the code;

Code: Select all

$query2 = "INSERT INTO audithistory(id, postdate, title, username )
VALUES('$title', NOW(), '$asset deleted from the database', '$name')";
$result2 = mysql_query($query2);
Any ideass why this is not going through.


regards,
Mark
User avatar
mhouldridge
Forum Contributor
Posts: 267
Joined: Wed Jan 26, 2005 5:13 am

Post by mhouldridge »

sorted it out now,

I was using a primary key for one field, and it wouldnt allow another field with the same id.
Post Reply