Guest_imported
New member
- Jan 1, 1970
- 0
I have 2 tables in mysql
table 1 name: ex_main
contains ex_id and author_id
table 2 name: ex_author
contains author_id and author_name
i want to query to find all ex_id's in ex_main that
have the same name as my query
tried this (does not work...)
SELECT EX_MAIN.EX_ID FROM EX_MAIN AND EX_AUTHOR WHERE EX_AUTHOR.NAME LIKE '%$NAME%' AND EX_AUTHOR.AUTHOR_ID LIKE EX_MAIN.AUTHOR_ID
where the %'s are the wildcards and the $NAME is the variable in PHP that resolves the the correct string - i know these work and are not the problem.
i have verified the data in my mysql database and i can get this to work with 2 separate queries - is it possible to have this done with one query?
TIA! ;-)
--Mike
table 1 name: ex_main
contains ex_id and author_id
table 2 name: ex_author
contains author_id and author_name
i want to query to find all ex_id's in ex_main that
have the same name as my query
tried this (does not work...)
SELECT EX_MAIN.EX_ID FROM EX_MAIN AND EX_AUTHOR WHERE EX_AUTHOR.NAME LIKE '%$NAME%' AND EX_AUTHOR.AUTHOR_ID LIKE EX_MAIN.AUTHOR_ID
where the %'s are the wildcards and the $NAME is the variable in PHP that resolves the the correct string - i know these work and are not the problem.
i have verified the data in my mysql database and i can get this to work with 2 separate queries - is it possible to have this done with one query?
TIA! ;-)
--Mike