hi!!
is there any method to join 2 mysql tables..
i m thinking to make a gallery page and i think for the gallery i need to tables and it may need to join both tables....
is there any way to make simple gallery script with mysql backend?
Help me guys..... i am a simple php coder(not a professional)....
please......
i will be very grateful to you...
thanks in advance..
join table??
Moderator: General Moderators
Re: join table??
i dont really understand your question
but
simple way to join 2 tables
table 1
table 2
Joining 2 tables to get category name for each image
You also can use INNER JOIN, LEFT JOIN, RIGHT JOIN sql syntax to join 2 tables
Please refer here for more info http://www.w3schools.com/sql/sql_join.asp
but
simple way to join 2 tables
table 1
Code: Select all
CREATE TABLE category (
category_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
category_name VARCHAR( 255 ) NOT NULL
) ENGINE = innodb;Code: Select all
CREATE TABLE gallery (
image_id INT NOT NULL ,
category_id INT NOT NULL ,
image_desc VARCHAR( 255 ) NOT NULL ,
image_location VARCHAR( 255 ) NOT NULL
) ENGINE = innodb;Code: Select all
SELECT g.image_id, g.image_desc, g.image_location, c.category_name
FROM gallery as g, category as c
WHERE c.category_id = g.category_idPlease refer here for more info http://www.w3schools.com/sql/sql_join.asp
Re: join table??
yeah i am looking this kind of code
i think u can code this gallery i m looking for...
can you please submit the gallery code you got??
i will be very very grateful to you....
i think u can code this gallery i m looking for...
can you please submit the gallery code you got??
i will be very very grateful to you....