TeddyKiller Posted March 15, 2010 Share Posted March 15, 2010 When $qname['name'] has a value of ex: warrior's, It is thinking the ' is syntax. How can I prevent this? $q1 = $db->execute("update `users` set `".$_GET['slot']."` = '".$qname['name']."' where `id`=?", array($player->id)) or die("query failed: ".mysql_error()); Thanks Link to comment https://forums.phpfreaks.com/topic/195351-uery-failed-you-have-an-error-in-your-sql-syntax/ Share on other sites More sharing options...
MatthewJ Posted March 15, 2010 Share Posted March 15, 2010 mysql_real_escape_string Link to comment https://forums.phpfreaks.com/topic/195351-uery-failed-you-have-an-error-in-your-sql-syntax/#findComment-1026572 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.