I have a @ I am attempting to run against a MySQL databse on a Linux Server running Apache 1.3.28, PHP 4.3.2, and MySQL 4.0.15-standard. It is pretty simple code since I am a beginner attempting to learn PHP, but I can't seem to get this one to work. It connects fine, but it returns "Couldn't Execute Query" everytime. I have pasted the code below. If anyone knows what is wrong or might be wrong please share or email me.
---------THE CODE----------
<?
if ((!$id) || (!$format) || (!$title)) {
header( "Location:http://blue.com/blue.htm");
exit;
}
$db_name = "blue_testDB";
$table_name = "my_music";
$connection = @mysql_connect("localhost", "blue_dwatson", "blueballs") or die("Couldn't connect.");
$db = @mysql_select_db($db_name, $connection) or die("Couldn't select database.");
$sql = "
INSERT INTO $table_name(id, format, title, atist_fn, artist_ln, rec_label, my_notes, date_acq)
VALUES(\"$id\",\"$format\",\"$title\",\"$artist_fn\",\"$artist_ln\",\"$rec_label\",\"$my_notes\",\"$date_acq\")
";
$result = @($sql,$connection) or die("Couldn't execute query.");
?>
I inserted "blue" into the domain name, etc. in order to keep my site private. If anyone knows why the query is not executing please share.😕 😕 😕