I'm executing a query that returns some a UID and a company name.  I'm using 
the following code to loop over that query result set:

        $result = mysql_query($myQuery) //$myQuery gets defined earlier
        $resultCount = mysql_num_rows($result);
        $companyID = array();
            while($query_data = mysql_fetch_row($result)) {
                $companyID[$query_data[0]] = $query_data[1];
                $companyID_string .= "," . $query_data[0];
                $companyName_string .= "," . $query_data[1];
            }

I've used $resultCount to verify the query is returning 4 rows.  However, the 
while loop above is looping over the results twice -- $companyID_string and 
$companyName_string each have 8 values.  Looking at the values shows that 
it's the 4 rows duplicated.

What the heck am I doing wrong?

--kurt

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to