need tutorial how to display multiple tables from database. i have table (price) that holds various pricing data related to table (acc_establishments). how do i link tables together to display data (price) that corresponds to (acc_establishments). need a simple example how to do this. thanks
sjeggels
0
Newbie Poster
Recommended Answers
Jump to Postuse joins in mysql. it will help you
Jump to Postyou need to join two tables together
assuming you had these 2 table
ill make this example simple/* tables */
price
price_id - int(autoincrement)
prod_price - doubleacc_establishments
prod_id - int(autoincrement)
prod_name - varchar
price_id - int/* query */
select ae.prod_name, p.prod_price from acc_establishments as …
Jump to PostYou should post your code here so that contributors can make solutions specific to your needs. However, good advice so far - use joins. Your example probably requires the INNER JOIN.
$recordset = mysql_query(" SELECT t1.field4, t2.field7 FROM table1 AS t1 INNER JOIN table2 AS t2 ON …
All 9 Replies
rajabhaskar525
1
Junior Poster
vaultdweller123
32
Posting Pro
diafol
vaultdweller123
32
Posting Pro
sjeggels
0
Newbie Poster
diafol
vaultdweller123
32
Posting Pro
vaultdweller123
32
Posting Pro
vaultdweller123
32
Posting Pro
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.