Jump to content

[SOLVED] error


ohdang888

Recommended Posts

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 's Testing app', '2008-11-14 18:04:03')' at line 1

 

 

mysql_query("INSERT INTO `page_admins` (`user_id`, `page_id`, `page_name`, `date`)VALUES('$user', '$page_id', '$page_name', '$date') ")or die(mysql_error());

 

any ideas???

 

thanks!

Link to comment
https://forums.phpfreaks.com/topic/132770-solved-error/
Share on other sites

$page_id = mysql_real_escape_string($_GET['page_id']);

$page_name =  mysql_real_escape_string($_GET[''page_name]);

 

if(empty($page_name) or empty($page_id)){

die("Page does not exist");

}

 

$date = date("Y-m-d H:i:s");

 

mysql_query("INSERT INTO `page_admins` (`user_id`, `page_id`, `page_name`, `date`)VALUES('$user', '$page_id', '$page_name', '$date') ")or die(mysql_error());

}

 

 

user is pre-defined.... all the values exist.... the page name in this case is  "  Tommy's testing app"

Link to comment
https://forums.phpfreaks.com/topic/132770-solved-error/#findComment-690501
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.