dalton6275 Posted April 11, 2006 Share Posted April 11, 2006 I have an 'insert into database' code which i am trying to make the table the information is inserted to dependant on a URL variable i am carrying across from the previous page. My code is [code]if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO %s (Monthref, percentage) VALUES (%s, %s)", GetSQLValueString($_POST['sla'], "text"), GetSQLValueString($_POST['month'], "date"), GetSQLValueString($_POST['slapercent'], "int"));[/code]but it is not liking the 1st %s code in the 'INSERT INTO %s'Anyone know how i can remedy this??? Link to comment https://forums.phpfreaks.com/topic/7117-dynamic-insert-into-sql/ Share on other sites More sharing options...
Barand Posted April 11, 2006 Share Posted April 11, 2006 What does $_POST['sla'] contain? Link to comment https://forums.phpfreaks.com/topic/7117-dynamic-insert-into-sql/#findComment-25976 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.