Zergman Posted February 23, 2009 Share Posted February 23, 2009 I have a simple form that has a list with 4 values in it. Its set to multiple as I want to allow for more than 1 selection. Problem is im getting a syntax error when submitting the form. Here's the code for the comma seperated part $access = $_GET['access']; if (isset($_GET['access'])) { $comma_separated = "'" . implode("','", $access) . "'"; } else { $comma_separated = "'vsuser','vsadmin','nsuser','nsadmin'"; } if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { $updateSQL = sprintf("UPDATE user_logins SET user_name=%s, password=%s, email=%s, 'access' IN ($comma_separated), first_name=%s, last_name=%s, theme=%s, layout=%s, status=%s, `group`=%s WHERE id=%s", GetSQLValueString($_POST['user_name'], "text"), GetSQLValueString($_POST['password'], "text"), GetSQLValueString($_POST['email'], "text"), GetSQLValueString($_POST['first_name'], "text"), GetSQLValueString($_POST['last_name'], "text"), GetSQLValueString($_POST['theme'], "text"), GetSQLValueString($_POST['layout'], "text"), GetSQLValueString($_POST['status'], "text"), GetSQLValueString($_POST['group'], "text"), GetSQLValueString($_POST['id'], "int")); Not sure what im doing wrong Link to comment https://forums.phpfreaks.com/topic/146480-solved-comma-seperated-values-in-update-form/ Share on other sites More sharing options...
Zergman Posted February 23, 2009 Author Share Posted February 23, 2009 Closing as this is not a good way to accomplish what I want. Link to comment https://forums.phpfreaks.com/topic/146480-solved-comma-seperated-values-in-update-form/#findComment-769472 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.