That last tip of yours was a good one.
I intentially left the space under
Code: Select all
$row = mysql_fetch_array($result);
open, for extra info to come.
I just didn't know what to put there.
So your extra input was most welcome. It worked like a dream.
Now step 1 has been taken, and it's time to move on.
I am really trying to get info (
not all !!) from 2 tables into 1 mail.
Both tables have the identifier 'orderid' which gives me a reference.
My question now is:
How can I fulfill this ???
To start with my 'SELECT'-statement:
The orderid is indeed limited to 1, but there are a number of fields inthere.
Therefore:
Code: Select all
$query = "SELECT * FROM orders ORDER BY orderid DESC LIMIT 1";
can produce an output of more than 1 (this field has info like: mail, address, city, amount etc)
Another table is called 'order_items' where article_price, article_number and quantity are stored in.
I have tried the command:
Code: Select all
$query = "SELECT * FROM orders,order_items WHERE orderid = '$orderid' ORDER BY orderid DESC LIMIT 1";
but the result is a fault-code which says:
SELECT Error: Column: 'orderid' in where clause is ambiguous
I have tried other ways, with 'orderid' as my main parameter, but the fault has probably something to do with the 2 tables in my SELECT parameter.
Am I correct, or is my way of thinking completely wrong???