On Thursday 07 November 2002 15:15, Steve Jackson wrote:
> My second query still doesn't return anything? Even with $orderid = $row
> removed as Jason suggested.
What exactly do you mean by "doesn't return anything"?
a) Does the second query fail?
b) Do you get any errors?
If no to both (a) and (b) then your query succeeded.
Now, your code below as-is does not do anything with the 2nd query results.
You've only used extract() on it, which by itself is not much use, unless you
use the variables that has been extracted. Read my previous post about what
extract() does (and read the manual for heaven's sake)
Also make liberal use of print_r() to see what values your variables contain
at different stages of your program.
> This is my current 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
> while( $row = mysql_fetch_array($result))
> //$orderid = $row;
> $query2 = "SELECT * FROM orders WHERE orderid=\"$orderid\"";
> $result2 = mysql_query($query2) or die("Error: cannot fetch
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
One Bell System - it works.
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php