Results 1 to 9 of 9

Thread: data in sql

  1. #1
    Join Date
    Jul 2007
    Location
    trg
    Posts
    4
    Rep Power
    0

    data in sql

    cmne nk insert data yg sma ke dlm 2 table sql yg b'beza.

    ada sesape yg blh tlg..

  2. #2
    Join Date
    Sep 2005
    Location
    in my body lar...
    Posts
    1,325
    Rep Power
    0
    Quote Originally Posted by jauzakamilia View Post
    cmne nk insert data yg sma ke dlm 2 table sql yg b'beza.

    ada sesape yg blh tlg..
    aiya your question is too general so i give you a general answer. -->> just use two different sql insert statement will do lor...

    if you want a detailed help, please provide more details like what you wanted to achieve? what database u are using? what type of scripts u are using? what coding have you done so far? what error message you ecountered?

    if you give us more details, the better members here can help you out....
    to get proper help, plz provide proper question to help us help you okie....

  3. #3
    Join Date
    Jul 2007
    Location
    trg
    Posts
    4
    Rep Power
    0
    $insertSQL = sprintf("INSERT INTO data_user (id_user, password, namapenuh, no_kp, email, alamat, no_telefon, no_faks, pilih) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
    GetSQLValueString($_POST['id_user'], "text"),
    GetSQLValueString($_POST['password'], "text"),
    GetSQLValueString($_POST['namapenuh'], "text"),
    GetSQLValueString($_POST['no_kp'], "text"),
    GetSQLValueString($_POST['email'], "text"),
    GetSQLValueString($_POST['alamat'], "text"),
    GetSQLValueString($_POST['no_telefon'], "text"),
    GetSQLValueString($_POST['no_faks'], "text"),
    GetSQLValueString($_POST['pilih'], "text"));



    i nk mskkn no_kp dlm anther table.

  4. #4
    Join Date
    Aug 2006
    Location
    Malaysia
    Posts
    1,576
    Rep Power
    185
    Just creating another SQL query for it will do.

  5. #5
    Join Date
    Sep 2005
    Location
    in my body lar...
    Posts
    1,325
    Rep Power
    0
    Quote Originally Posted by jauzakamilia View Post
    $insertSQL = sprintf("INSERT INTO data_user (id_user, password, namapenuh, no_kp, email, alamat, no_telefon, no_faks, pilih) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
    GetSQLValueString($_POST['id_user'], "text"),
    GetSQLValueString($_POST['password'], "text"),
    GetSQLValueString($_POST['namapenuh'], "text"),
    GetSQLValueString($_POST['no_kp'], "text"),
    GetSQLValueString($_POST['email'], "text"),
    GetSQLValueString($_POST['alamat'], "text"),
    GetSQLValueString($_POST['no_telefon'], "text"),
    GetSQLValueString($_POST['no_faks'], "text"),
    GetSQLValueString($_POST['pilih'], "text"));



    i nk mskkn no_kp dlm anther table.
    aiyo... if the no_kp stored in other table.... just use another SQL INSERT statement to add that to the table... there's no shortcut for you this time....

  6. #6
    Join Date
    Jul 2007
    Location
    trg
    Posts
    4
    Rep Power
    0
    $insertSQL = sprintf("INSERT INTO complain ( no_kp) VALUES (%s)",
    GetSQLValueString($_POST['no_kp'], "text");

    u mean like this?it works bt the other data(name,add etc) not insert in d db

  7. #7
    Join Date
    Sep 2005
    Location
    in my body lar...
    Posts
    1,325
    Rep Power
    0
    Quote Originally Posted by jauzakamilia View Post
    $insertSQL = sprintf("INSERT INTO complain ( no_kp) VALUES (%s)",
    GetSQLValueString($_POST['no_kp'], "text");

    u mean like this?it works bt the other data(name,add etc) not insert in d db
    aiya.... sakit kepala lar.. what me and genzy say is use two(2) seperate insert statement... use 2 different sql statement instead on just one.....


    1st statement will insert the data (name,add etc) into the 1st table and the 2nd statement will insert no_kp into the 2nd table.

    1st Statement
    $insertSQL = sprintf("INSERT INTO data_user (id_user, password, namapenuh, email, alamat, no_telefon, no_faks, pilih) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)",
    GetSQLValueString($_POST['id_user'], "text"),
    GetSQLValueString($_POST['password'], "text"),
    GetSQLValueString($_POST['namapenuh'], "text"),
    GetSQLValueString($_POST['email'], "text"),
    GetSQLValueString($_POST['alamat'], "text"),
    GetSQLValueString($_POST['no_telefon'], "text"),
    GetSQLValueString($_POST['no_faks'], "text"),
    GetSQLValueString($_POST['pilih'], "text"));

    2nd Statement
    $insertSQL = sprintf("INSERT INTO complain ( no_kp) VALUES (%s)",
    GetSQLValueString($_POST['no_kp'], "text");
    who not create the no_kp field into "data_user" and store it there? why susah susah left one fields into other file???? i guess you need to optimize the data table dude....

  8. #8
    Join Date
    Jul 2007
    Location
    Selangor
    Posts
    6
    Rep Power
    0
    create another!

  9. #9
    Join Date
    Oct 2005
    Location
    KLC
    Posts
    91
    Rep Power
    165
    kalau cam cara kat atas, cam ne nak tau no_kp tu utk sape? tapi kan, nape lak nak pakai table lain utk no_kp? cuba citer skit.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Data Typing Job
    By srimanmath in forum Job Vacancies
    Replies: 0
    Last Post: 23-12-2009, 07:36 PM
  2. data cleansing, data management and web design
    By fiafeehily in forum Other Internet Marketing Methods
    Replies: 0
    Last Post: 06-12-2009, 07:48 PM
  3. data entry job
    By gyu1456bsk in forum Job Vacancies
    Replies: 0
    Last Post: 23-08-2008, 02:24 PM
  4. Data Entry Job
    By gyu1454bsk in forum Job Vacancies
    Replies: 0
    Last Post: 22-08-2008, 08:27 PM
  5. sorting data
    By gundam_seat in forum Website Programming
    Replies: 2
    Last Post: 06-08-2005, 10:16 AM

Posting Permissions

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

Search Engine Optimization by vBSEO 3.5.0 RC1 PL1

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37