Mysql problem(Very Urgent)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • djdarpan
    New Member
    • May 2007
    • 4

    Mysql problem(Very Urgent)

    Hi,

    I am new in mysql and php and I want to insert data in a table from two different input form. Plz help me,

    I want like this e.g.
    Form 1 contains "username". Form 2 contains "password";

    both different value insert in single table same row. Is that possible, if yes plz help me out.

    Thanks in advance!

    DJ
  • cyberking
    New Member
    • Jan 2007
    • 84

    #2
    Originally posted by djdarpan
    Hi,

    I am new in mysql and php and I want to insert data in a table from two different input form. Plz help me,

    I want like this e.g.
    Form 1 contains "username". Form 2 contains "password";

    both different value insert in single table same row. Is that possible, if yes plz help me out.

    Thanks in advance!

    DJ
    Hi.
    Well firstly now that you want to put in a value from one form and another value from another form, its possible with an INSERT query first and an UPDATE query next. This is because, you cannot be feeding data to the database at the sametime because you say you have two forms. Further, now that you wanna put data into the same row, you ll need to update the row when you are feeding in the value for the second time.

    So lest say first you are feeding in the username, then

    mysql_query("IN SERT INTO db.table_name VALUES('user_na me')");
    By now the password field here is empty but you have put in the user name. Now from form2 ,to put the password, your query will be like this,

    mysq_query("UPD ATE db.table_name SET(passwd = '$password') WHERE user_name = '$user_name_sid e_to_whic_you want_this_passw ord'");

    well hope this helps you
    Regards
    CyberKing
    http://www.bytesandbyt es.con

    Comment

    • cyberking
      New Member
      • Jan 2007
      • 84

      #3
      sorry, it has to be

      mysql_query("IN SERT INTO db.table_name(u sername) VALUES('$user_n ame')"); I missed out the field specification

      Regards,
      CyberKing

      Comment

      • djdarpan
        New Member
        • May 2007
        • 4

        #4
        Thanks buddy,

        It's working.

        Thank you very much.

        I need one more help from you.

        I have a two form and user submitted first form partial then logout. Second time when user login they see same incomplete("job _success.php") form for complete and if user completed all fields and login again user see new form ("login_success .php").

        I have write a query for searching null field in MySQL then display incomplete form if not null return fresh form. But it cann't work. My query is below:

        [PHP]

        $query = "SELECT * FROM jstatus WHERE page IS NULL && etime IS NULL";
        $ss = mysql_query($qu ery);
        $cc=mysql_num_f ields($ss);
        if($cc==0){
        header("locatio n:login_success .php?title=go?? sessionid=0d0a0 r0p0a0n");
        } else{
        header('Locatio n: job_success.php ');

        }

        [/PHP]


        I hope i am not bored you.

        Please help me

        Thanks,

        DJ

        Comment

        Working...