> On Wednesday 06 November 2002 16:52, Steve Jackson wrote:
> > Ok this is starting to get complex! (For me anyway)
> > This is my function:
> > function get_order_numbers()
> > {
> > $conn = db_connect();
> > $query = "select orders.orderid from orders, email where 
> > orders.orderid = email.orderid and email.checked='no'"; $result = 
> > mysql_query($query) or die("Error: cannot select 
> > orderid<BR>$query<BR>".mysql_error());
> > while( $row = mysql_fetch_array($result))
> >     {
> >     extract($row);
> 
> According to your query it should return a single result 
> (assuming your 
> orderid is unique -- and it should be), and that single 
> result contains a 
> single field called "orderid".
> 
> Use print_r($row) to see exactly what it contains (good for 
> reference and 
> debugging).


It doesn't contain a single result. It returns 16 order numbers (which
is correct - 8 should be in the table emails with no checked and
therefore the query has worked and pulled out 8 from the orders table
also). What I want the function to do is say OK where the orderid's
match pull out all the address details for each orderid and display what
I want displayed accordingly. At the moment I get this array returned by
using print_r($row).
Array ( [0] => 100040 [orderid] => 100040 ) Array ( [0] => 100041
[orderid] => 100041 ) Array ( [0] => 100043 [orderid] => 100043 ) Array
( [0] => 100044 [orderid] => 100044 ) Array ( [0] => 100046 [orderid] =>
100046 ) Array ( [0] => 100050 [orderid] => 100050 ) Array ( [0] =>
100051 [orderid] => 100051 ) Array ( [0] => 100052 [orderid] => 100052 )

Where do I go from here?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to