printing value of SELECT table.name AS alias
Posted: Thu Mar 02, 2006 9:53 am
It may be that it's early in the morning, but I can't get my brain to wrap around this simple concept. Here's my mySQL query:
Pretty simple. Now I want to print the values of "capacity" and "name" to the screen. I know this is very simple, but I just can't seem to get it.
Code: Select all
$sql="
SELECT mytable.capacity AS 'capacity', yourtable.name AS 'name'
FROM mytable, yourtable
WHERE mytable.id=$myId AND yourtable.id=$yourId";
$result=mysql_query($sql, $conn);