Forum Moderators: coopster
Invalid query: 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 '' at line 1 Whole query: SELECT * FROM albums WHERE albumid=
The strange thing is that for a SPLIT second I can see that it was successful and it updates the information, but then it changes to the invalid query message.
Here is the code behind it:
if ($_POST['editinformation'])
{
$albumname=($_POST['albumname']);
$artistname=($_POST['artistname']);
$dateadd=($_POST['dateadd']);
$genre=($_POST['genre']);
$oreleasedate=($_POST['oreleasedate']);
$dreleasedate=($_POST['dreleasedate']);
$labelname=($_POST['labelname']);
$upc=($_POST['upc']);
$recordlocation=($_POST['recordlocation']);
$query = "UPDATE albums SET albumname='$albumname', artistname='$artistname', genre='$genre', oreleasedate='$oreleasedate', dreleasedate='$dreleasedate', labelname='$labelname', upc='$upc', recordlocation='$recordlocation' WHERE albumid='$album'";
$result = mysql_query($query);
if ($result)
{ echo $query; }
else if (!$result)
{
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}
}
And I know it was successful through the first runthrough because when i go to a seperate page taht pulls the information, i receive the updated information