Hi people
I am at frustration overflow…
Have an html form for data entry which posts to insert_ac.php, when I post the form I get this:
Warning: mysql_query() expects parameter 1 to be string, resource given in /home/content/52/11733052/html/admin/insert_ac.php on line 24
Here is the code:
[php]<?php
$username = "nlladmin";
$password = "password";
$hostname = "localhost";
$link = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
$selected = mysql_select_db("nlladmin",$link)
or die("Could not select Admin Database");
// Get values from form
$make=$_POST['make'];
$model=$_POST['model'];
$assetnum=$_POST['assetnum'];
$registration=$_POST['registration'];
// Insert data into mysql
$sql="INSERT INTO assets (make, model, assetnum, registration)VALUES('$make', '$model', '$assetnum', $registration')";
if (!mysql_query($link,$sql))
{
die('Error: ’ . mysql_error($link));
}
echo "1 record added";
mysql_close();
?>[/php]
Any suggestions will be most appreciated.
Thanks
essenz