www.webdeveloper.com
Results 1 to 8 of 8

Thread: please help php query error.??

Threaded View

  1. #1
    Join Date
    Jan 2014
    Location
    Pakistan
    Posts
    45

    please help php query error.??

    hello everybody...i have an error when i submit data into database..please check it out..
    phph code is
    PHP Code:
    <?php
    $con
    mysql_connect('abc.com''colg''Colg@1'); 
    if (!
    $con) { 
        die(
    'Could not connect: ' mysql_error()); 

    mysql_select_db(colg);

    $sql="INSERT INTO fsc_med(reg_id,f_name,l_name,roll_num,t_eng,o_eng,t_urdu,o_urdu,t_phy,o_phy,t_che,o_che,t_bio,o_bio,t_isl_sstd,o_isl_sstd,total_marks,obtain_marks,attendance)
    VALUES
    ('
    $_POST[reg_num]','$_POST[firstname]','$_POST[lastname]','$_POST[rollnum]','$_POST[t_english]','$_POST[o_english]','$_POST[t_urdu]','$_POST[o_urdu]','$_POST[t_physics]','$_POST[o_physics]','$_POST[t_chemistry]','$_POST[o_chemistry]','$_POST[t_biology]','$_POST[o_biology]','$_POST[t_isl_sst]','$_POST[o_isl_sst]','$_POST[t_marks]','$_POST[o_t_marks]','$_POST[attdnce]')";

    if (!
    mysqli_query($con,$sql))
      {
      die(
    'Error: ' mysqli_error($con));
      }
    echo 
    "1 record added";

    mysqli_close($con);
    ?>
    data entry form is here http://igoc.com.pk/student_results/r...c_med_123.html
    Last edited by NogDog; 03-04-2014 at 01:46 PM. Reason: added [php] tags around code

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles