Creating a view from multiple tables |
Creating a view from multiple tables |
tudsy |
Aug 5 2018, 11:32 PM
Post
#1
|
Advanced Member Group: Members Posts: 248 Joined: 30-September 14 Member No.: 21,611 |
Hi
I have 4 tables, CustomersArt,Customers,subscribers and emailcomm. My question is, how do i create a view from these 4 tables with the column email ? I have done a view from one table (see below): $query = "CREATE VIEW ecovib2d AS SELECT email FROM CustomersArt"; Any help will be appreciated. |
tudsy |
Aug 15 2018, 11:27 PM
Post
#2
|
Advanced Member Group: Members Posts: 248 Joined: 30-September 14 Member No.: 21,611 |
Hi
I have another problem. Here is a query: $query = "CREATE VIEW ecovib2d AS SELECT Customers.*,subscribers.*,CustomersArt.*,CustomersVideo.*,emailcomm.* FROM Customers FULLJOIN CustomersArt ON (CustomersArt.Itemid = Customers.Itemid ) FULLJOIN CustomersVideo ON (CustomersVideo.Itemid = Customers.Itemid ) FULLJOIN subscribers ON (subscribers.Itemid = Customers.Itemid ) FULLJOIN emailcomm ON (emailcomm.Itemid = Customers.Itemid ) WHERE email ='$Email'"; the runtime error is as follows: Error Message: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'FULLJOIN CustomersArt ON (CustomersArt.Itemid = Customers.Itemid ) ' at line 4 Any help will be greatly appreciated.Thanks. |
Lo-Fi Version | Time is now: 26th September 2024 - 02:42 PM |