Results 1 to 6 of 6

Thread: select 2 table

  1. #1
    Join Date
    Jan 2005
    Location
    kuala lumpur
    Posts
    7
    Rep Power
    0

    Question select 2 table

    kengkawan... ..ada masalah skit ler....macam mana nak select field dalam 2 table yang berasingan...aku nak display semua field yang ada dalam kedua - dua table tuh dalam satu form....mintak tolong tunjuk skit skill tuh.....

    cam ner yerk.....

  2. #2
    Join Date
    Feb 2003
    Location
    Kluang, Johor
    Posts
    2,367
    Rep Power
    247
    I assume you were referring to database table not HTML table, you need to use JOIN table SQL query to select two tables, join them and get the records of all fields. If you are using MySQL, please refer to manual at http://www.mysql.com

  3. #3
    Join Date
    Jan 2005
    Location
    kuala lumpur
    Posts
    7
    Rep Power
    0

    Wink

    sori tadi....macam nih..aku guna ASP...database access....aku create 2 table...
    1- table company : field ( DO,tarikh,caw,pelanggan )
    2- table projek :field ( DO,tarikh,no_contrak,kuantiti)

    * DO : sebagai primary key

    masalahnya..aku nak joint 2 table tuh, untuk display jadi satu jerr...ia kuar camni...

    contoh :
    DO Tarikh Caw pelanggan
    125 12/2/2005 KL ABE Enterprise

    No_Contrak Kuantiti
    125 200 Kg
    200 350 kg


    kat bawah nih...command yang aku cuba guna....contoh yang aku cari kat internet......tp dia tak nak jadi lak.....

    set rs=Server.CreateObject("ADODB.recordset")
    sConnString = "DRIVER={Microsoft Access Driver (*.mdb)};" & _
    "DBQ=" & Server.MapPath("stock.mdb") & ";"
    sqlstmt = "SELECT DO,tarikh,caw,pelanggan
    FROM company
    INNER JOIN projek
    ON Keluar.DO = projek.DO
    rs.open sqlstmt, sConnString


    aku harap ko faham.....
    Last edited by meiji; 31-01-2005 at 04:39 PM.

  4. #4
    Join Date
    Feb 2003
    Location
    Kluang, Johor
    Posts
    2,367
    Rep Power
    247
    I have forgot about Access. Anyway, your sql statement is incorrect. Replace sqlstmt query string with the following:

    Code:
    sqlstmt = "SELECT DO,tarikh,caw,pelanggan
    FROM company INNER JOIN projek
    ON company.DO = projek.DO
    Hope this helps.

  5. #5
    Join Date
    Jan 2005
    Location
    kuala lumpur
    Posts
    7
    Rep Power
    0

    masih tak jadi

    Lcf....masih tak jadi la...boleh tak u bagi aku coding sepenuhnya yang u tahu....coding yang aku jumpa semua tak jadi....

  6. #6
    Join Date
    Feb 2003
    Location
    Kluang, Johor
    Posts
    2,367
    Rep Power
    247
    Do you get any error message?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How do you select your blog topics?
    By starsearcher in forum Blogging Discussion
    Replies: 2
    Last Post: 20-10-2013, 02:35 PM
  2. Select web hosting
    By Lawrence Lam in forum Paid Hosting Discussion Forum
    Replies: 17
    Last Post: 09-02-2010, 01:20 PM
  3. Replies: 0
    Last Post: 14-05-2007, 08:24 PM
  4. select box/drop down menu
    By hymns in forum Website Design
    Replies: 4
    Last Post: 21-07-2004, 04:24 PM
  5. retrieving select box..
    By joyce in forum Website Programming
    Replies: 4
    Last Post: 09-04-2002, 01:38 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