baig772 baig772 - 7 days ago 6
MySQL Question

What is wrong in this query?

This query:

SELECT tbl_deliverable.*, user_to_deliverable.*
where tbl_deliverable.id = user_to_deliverable.d_id


returns this error from phpmyadmin:


#1064
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
'where tbl_deliverable.id = user_to_deliverable.d_id'
at line 1


Why?

Answer

You forgot your "from tables" in the SQL:

SELECT tbl_deliverable.*,   user_to_deliverable.*
from   tbl_deliverable,     user_to_deliverable
where  tbl_deliverable.id = user_to_deliverable.d_id

Just add:

from tbl_deliverable, user_to_deliverable
Comments