Jump to content

[SOLVED] Two Tables/Join


947740

Recommended Posts

I need to select all of the data from these two tables with one query:

 

+----------+---------------------+------+-----+---------+----------------+
| Field    | Type                | Null | Key | Default | Extra          |
+----------+---------------------+------+-----+---------+----------------+
| ID       | bigint(20) unsigned | NO   | PRI | NULL    | auto_increment |
| sname    | varchar(50)         | YES  |     | NULL    |                |
| snumber  | int(4)              | YES  |     | NULL    |                |
| date     | varchar(30)         | YES  |     | NULL    |                |
| numberof | int(2)              | YES  |     | NULL    |                |
| teacher  | varchar(50)         | YES  |     | NULL    |                |
| com_rea  | varchar(255)        | YES  |     | NULL    |                |
+----------+---------------------+------+-----+---------+----------------+

+----------+---------------------+------+-----+---------+----------------+
| Field    | Type                | Null | Key | Default | Extra          |
+----------+---------------------+------+-----+---------+----------------+
| ID       | bigint(20) unsigned | NO   | PRI | NULL    | auto_increment |
| sname    | varchar(50)         | YES  |     | NULL    |                |
| snumber  | int(4)              | YES  |     | NULL    |                |
| date     | varchar(30)         | YES  |     | NULL    |                |
| numberof | int(2)              | YES  |     | NULL    |                |
| teacher  | varchar(50)         | YES  |     | NULL    |                |
| com_rea  | varchar(255)        | YES  |     | NULL    |                |
+----------+---------------------+------+-----+---------+----------------+

 

I will also have where clauses for both tables.  Any examples would be helpful.

Link to comment
https://forums.phpfreaks.com/topic/162613-solved-two-tablesjoin/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.