PHP/MySQL array w/zero results

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
This sql query is good but I'm having trouble echoing the results with
php (no data echoed). Suggestions?

$open_C = 'select * '
        . ' from questions , users '
        . ' where users . username = "X" LIMIT 0, 30 ';

// Fetch each row of the results into an array $q_row
while ($q_row = @mysql_fetch_array($open_C))
     echo "ID:\t\n";



Thank you.

Re: PHP/MySQL array w/zero results

At Wed, 16 May 2007 12:37:29 -0700, Akhenaten let his monkeys type:

Quoted text here. Click to load it
You have to open a connection to the db and execute the query first, then
fetch rows on the result resource:

$conn = @mysql_connect($host,$user,$pass)  
    or die (mysql_error());
    or die (mysql_error());
$result = mysql_query($open_C, $conn)
    or die (mysql_error());
while ($row = mysql_fetch_assoc($result))
// use mysql_fetch_assoc to get the associative array only.
    echo "ID:\t\n";


Site Timeline