Jump to content

[SOLVED] INSERT Trouble


iceblox

Recommended Posts

Hi Guys,

 

I have a simple form that i seem to be having issues with and I cant see why it isnt working.

 

This is the error i get

 

Array ( [message] => You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc, url, clickurl) VALUES ' at line 1 [code] => 1064 ) array(2) { ["message"]=> string(226) "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc, url, clickurl) VALUES ' at line 1" ["code"]=> int(1064) } bool(true) 

 

 

and this is the insert code

 

	if(!empty($_POST["addbutton"]))
{
	$result = $db->sql_query("INSERT INTO google (title, desc, url, clickurl) VALUES 
                                                     ('".forSql($_POST["title"])."', '".forSql($_POST["desc"])."', '".forSql($_POST["url"])."', '".forSql($_POST["clickurl"])."')");
	if($result)
		$status = "<b>".$_POST["title"] . " added successfully</b>";
	else
	{
		print_r($db->sql_error($result));
		$status = "<b>Error could not add banner. " . var_dump($db->sql_error($result),true);
	}
}

 

Any ideas?[/code]

Link to comment
https://forums.phpfreaks.com/topic/103240-solved-insert-trouble/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.