Hey,
I'm using the code:
function insertV($deptx, $coursex, $secx, $isbnx,$titlex, $authorx,$usedpx,$newpx)
{
$sql = "INSERT INTO `$deptx` (`course`, `sec`, `isbn`, `title`, `author`, `usedp`, `newp`)
VALUES ('$coursex','$secx','$isbnx','$titlex','$authorx','$usedpx','$newpx')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
}
$dept = "ACCOUNTG";
$course = "340";
$sec = "101";
$isbn = "9780324651140";
$title = "FINANCIAL ACCOUNTING";
$author = "STICKNEY";
$usedp = "$129.75";
$newp = "$199.75";
insertV($dept,$course,$sec,$isbn,$title,$author,$usedp,$newp);
But I keep getting an error:
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/public_html/mysite.com/myscript.php on line 14 Error:
I'm guessing it has to do with me trying to access a table using a var?
Any help would be appreciated, I'm still new to PHP if you couldn't tell :P
Thanks!
EDIT: Oh yeah, line 14 is
if (!mysql_query($sql,$con))