Ok, so I am having some user-inputed data inserted into the table "nav_links" and it outputs this error:
Unknown column 'h' in 'field list'
I have got the area down to this piece of code.
elseif($_GET['do'] == 'add_link')
{
$id = $_GET['cat'];
if($_GET['go']=='true')
{
$link_name = $_POST['link_name'];
$url = $_POST['url'];
if(empty($link_name))
{
$error_txt = 'Enter a link title.';
}
elseif(empty($url))
{
$error_txt = 'Enter a URL.';
}
else
{
$max = mysql_query('SELECT MAX(id) FROM nav_links');
$max_array = mysql_fetch_array($max);
$max_id = $max_array['MAX(id)'] +1;
$query = mysql_query('INSERT INTO `nav_links` (`id` ,`cat_id` ,`url` ,`name`) VALUES ('.$max_id.', '.$id.', '.$url.', '.$link_name.')');
if($query)
{
$error_txt = 'Link Added Successfully.';
}
else
{
$error_txt = mysql_error();
}
}
}
Any help?
Thanks in advance,
~Shaun