I'm a little confused on what this error message means. Is my user name and password incorrect or the path to the database incorrect or what?
Error is
Warning: mysql_db_query(): supplied argument is not a valid MySQL-Link resource in /home/syren/public_html/createtable.php on line 16
The query could not be executed
Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in /home/syren/public_html/createtable.php on line 21
I have been trying to play with user names and passwords but i used the one that i created in MYSQL editor. I have tried syren and syren_syren and syren_helpdesk and all sort of combinations. What should the format be and is this the problem?
Code is
<HTML>
<HEAD>
<TITLE></Title>
<body>
<?PHP
$Host="localhost";
$User="syren_syren";
$Password="*****";
$DBName="syren_helpdesk";
$TableName="Downtime";
$link = mysql_connect ($host, $User, $Password);
$Query ="CREATE table $TableName (id INT unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY, Ticket varchar(6), System VarChar(20), Verbiage VarChar(85), Analyst VarChar(20), Worker VarChar(20))";
if (mysql_db_query ($DBName, $Query, $Link)) {
print ("The query was executed");
} else {
print ("The query could not be executed");
}
mysql_close ($Link);
?>
</body>
</html>