I have a select statement for example:
SELECT table1.id, name, table2.id, branch FROM table1 INNER JOIN table2 ON userid = table2.id WHERE table1.id = 30;
So, this is just an example. The problem I’m having is now doing this:
$row = mysql_fetch_array($result)
Since there are two IDs being selected, my array looks like this:
$row['id'] = table2.id $row['name'] = name $row['branch'] = branch
There isn’t a second id item in the array and instead the first is being overwritten by the second value.
What am I doing wrong?
Edit: Actually the array looks more like this:
Array (  => table1.id [id] => table2.id  => name [name] => name  => table2.id  => branch [branch] => branch )