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
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...

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.