I have a mysql join which is pulling from two tables name product & cart and they're both being pulled from a variable $row_checkout
If i have to echo a certain field, i can normally go $row_checkout['cartid'] and that works fine.
However, i have a coloumn in each table which is called the same 'Status'.
How do i echo from one of the tables? I thought something like $row_checkout['cart.status'] might work but it doesnt appear to?
My database code is as follows:
$colname_checkout = "-1";
if (isset($row_booking['sessionid'])) {
$colname_checkout = (get_magic_quotes_gpc()) ? $row_booking['sessionid'] : addslashes($row_booking['sessionid']);
}
mysql_select_db($database_main, $main);
$query_checkout = sprintf("SELECT * FROM cart, productdatabase WHERE cart.productid = productdatabase.productid AND cart.status != 1 AND cart.status != 0 AND cart.sessionid = '%s' ORDER BY `name` ASC", $colname_checkout);
$checkout = mysql_query($query_checkout, $main) or die(mysql_error());
$row_checkout = mysql_fetch_assoc($checkout);
$totalRows_checkout = mysql_num_rows($checkout);