farahZ Posted July 8, 2013 Share Posted July 8, 2013 i am not able to figure out why my data isnt sent to the database!it was working fine before.. any help?var_dump isn't outputting if ( ! empty( $_POST ) ) { if(isset($_REQUEST['save'])) { if($sql=$db->query("INSERT INTO `kafala`.`std_basic` ( `fname` ,`sname` ,`lname` ,`mname` ,`std_num` ,`acc_family` ,`home_phone` ,`mobile_phone` ,`email` ,`std_type` ,`sex` ,`nas` ,`mazhab` ,`dob` ,`sec_lan` ,`pic`,`std_siblings`,`std_mo3arrif`) VALUES (NULL , '".es("fname")."', '".es("sname")."', '".es("lname")."', '".es("mname")."', '".es("std_num")."', '".es("acc_family")."', '".es("home_phone")."', '".es("mobile_phone")."', '".es("email")."', '".es("std_type")."', '".es("sex")."', '".es("nas")."', '".es("mazhab")."', '".es("dob")."','".es("sec_lan")."', '".$path."', '".es("std_siblings")."', '".es("std_mo3arrif")."')")); var_dump($sql); { echo "تمت اضافة الطالب<br>"; header("Location: newstd1.php"); } } } Link to comment https://forums.phpfreaks.com/topic/279955-query-connection-not-established/ Share on other sites More sharing options...
cyberRobot Posted July 8, 2013 Share Posted July 8, 2013 What errors are you getting? Note: the var_dump() function was added to the expression portion of the third if statement. It needs to go after the curly bracket. if($sql=$db->query("INSERT INTO `kafala`.`std_basic` (`fname` ,`sname` ... '".es("std_siblings")."', '".es("std_mo3arrif")."')")); var_dump($sql); { Also, you should probably review the manual for the header() function. http://php.net/manual/en/function.header.php Remember that header() must be called before any actual output is sent... Link to comment https://forums.phpfreaks.com/topic/279955-query-connection-not-established/#findComment-1439909 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.