Code:
$dbc = mysql_connect('localhost', 'root', '72031118311')
//if(!$dbc)
//{ unable to connect
or die('could not connect to the requested database'. mysql_error());
//
echo "connection successful";
mysql_close($dbc);
echo "<br />";
//create a query and store it as a string in a php variable
$query = "INSERT INTO contacts(first,middle,surname,email, phone,home,office)
VALUES('$first','$middle','$surname','$phone','$email','$home','$office')";
$result = mysql_query($dbc,$query)
or die('Error querying database');
mysql_close();
The error message"Warning: mysql_query() expects parameter 1 to be string, resource given in C:\wamp\www\Nexus\contact.php on line 19" what is wrong with this code?