I am trying to make a php calendar, as part of a project, and here I am executing some SQL with php:
mysql_select_db("waycov_dtm", $con);
$data="'Placeholder Text'";
$sql="INSERT INTO waycov_dtm.calDates (dateID, day, month, year)
VALUES (" . $dateID . ", " . $day . ", " . $month . ", " . $year . ");
INSERT INTO waycov_dtm.calData (dateID, data, memberID)
VALUES (" . $dateID . ", " . $data . ", 1);";
echo $sql;
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added";
mysql_close($con);
When this executes, I get the following (the echoed sql and then the error):
INSERT INTO waycov_dtm.calDates (dateID, day, month, year) VALUES (7072012, 7, 07, 2012); INSERT INTO waycov_dtm.calData (dateID, data, memberID) VALUES (7072012, 'Placeholder Text', 1);Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO waycov_dtm.calData (dateID, data, memberID) VALUES (7072012, 'Placeh' at line 3
If i take out any one insert statment, the other runs, but both together causes this??