Wrong Code?
Posted: Mon Jan 16, 2012 6:52 pm
I'm using this code in the same page. The last query works. Does anyone sees something wrong in the code?
The table name and the fields are ok.
The table name and the fields are ok.
$b_name = mysql_real_escape_string(htmlentities($_POST['b_name'])); // Updates Offers $of1 = mysql_real_escape_string(htmlentities($_POST['of1'])); $of2 = mysql_real_escape_string(htmlentities($_POST['of2'])); $of3 = mysql_real_escape_string(htmlentities($_POST['of3'])); $of4 = mysql_real_escape_string(htmlentities($_POST['of4'])); $of5 = mysql_real_escape_string(htmlentities($_POST['of5'])); $sql = "INSERT INTO `business_offers` (of1, of2, of3, of4, of5, username, b_name) VALUES ('{$of1}', '{$of2}', '{$of3}', '{$of4}', '{$of5}','{$_SESSION['username']}', '{$b_name}')"; mysql_query($sql); // WORKS $ev1 = mysql_real_escape_string(htmlentities($_POST['ev1'])); $ev2 = mysql_real_escape_string(htmlentities($_POST['ev2'])); $ev3 = mysql_real_escape_string(htmlentities($_POST['ev3'])); $ev4 = mysql_real_escape_string(htmlentities($_POST['ev4'])); $ev5 = mysql_real_escape_string(htmlentities($_POST['ev5'])); $sql = "INSERT INTO `business_events` (ev1, ev2, ev3, ev4, ev5, username, b_name) VALUES ('{$ev1}', '{$ev2}', '{$ev3}', '{$ev4}', '{$ev5}','{$_SESSION['username']}', '{$b_name}')"; mysql_query($sql);