Jump to content

query connection not established


farahZ

Recommended Posts

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

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.
 

Remember that header() must be called before any actual output is sent...

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.