Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax Error..

Status
Not open for further replies.

Thomas001

Programmer
Jun 24, 2004
29
US
This isn't getting put into the database, maybe it's because of a syntax error.. I'm not getting any error messages:


$creation = "INSERT INTO $uber_table ( `subject` , `comment` , `modif_sc` , `name` , `type`, `date` )
VALUES ('$subject', '$comment', '$modif_sc', '$name', '$type', NOW( ) )";


mysql_query($creation);
 
You should return a value from the call to mysql_query. In other words,

$result = mysql_query($creation);

Then, you'll be able to determine more easily what the problem may be:

$result = mysql_query($creation);
if (!$result) {
echo mysql_error, "<br>";
} else {
echo "successfully added row.";
}

Let me know what that error message says...

*cLFlaVA
----------------------------
A polar bear walks into a bar and says, "Can I have a ... beer?"
The bartender asks, "What's with the big pause?
 
*correction...

echo mysql_error(), "<br>";

*cLFlaVA
----------------------------
A polar bear walks into a bar and says, "Can I have a ... beer?"
The bartender asks, "What's with the big pause?
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top