I have these 2 mysql queryes
SELECT `name` AS name1,`id` AS id1 FROM `table` WHERE id=1
SELECT `name` AS name2,`id` AS name2 FROM `table` WHERE id=2
The results will be outputed like this
NAME1 ID1
john 1
NAME2 ID2
meg 2
Is there anyway that from 2 queries I would make 1 and it will show all results on 1 line from same table ?
NAME1 ID1 NAME2 ID2
john 1 meg 2
select tbl1.name,tbl1.id,tbl2.name,tbl2.id from mytable tbl1,mytable tbl2
but this query would be a mess, it will give you the whole combinations of two names in any order from your table, you could filter it with a WHERE clause but.. how many names do you have?? why doing that? maybe if we know what you’re trying to do we might give you a better answer
EDIT ohhh i see your queries now… it should be something like this