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).

extract($row) would assign to $orderid the value of $row['orderid'] (ie 
$orderid = $row['orderid']) ...

>       $orderid = $row;

... thus, I don't know why you have this line here. Remove it.

>       $query2 = "SELECT * FROM orders WHERE orderid=\"$orderid\"";

This fails because $row is an array and you assigned that to $orderid.

> What does extract do? I am under the assumption it extracts row
> information so why a datatype error?

rtfm for details and examples.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
"Take that, you hostile sons-of-bitches!"
-- James Coburn, in the finale of _The_President's_Analyst_
*/


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

Reply via email to