I don't think so, but if I have to suspect my code or a bug in php, I'll
suspect my code. :)
I did a quick "if (isset($companyID_string)) { print "true"; } else { print
"false";} and that didn't turn up anything, but I didn't spend a whole lot of
effort on it.
Like I said, I'm pretty sure I s
ieber" <[EMAIL PROTECTED]>
To: "Jim Lucas" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, October 25, 2001 1:17 PM
Subject: Re: [PHP] while() looping over query results twice?
> OK, so I defined the variables before using them and that solved the
problem.
OK, so I defined the variables before using them and that solved the problem.
(Thanks!)
I'm still curious as to why not defining them ahead of time would cause the
data within each string to get duplicated. In other words, if the query
results are "a,b,c,d", then by not defining the variable
me_string .= "," . $query_data[1];
}
Jim
ps. try using the mysql_fetch_array() and calling to the vars as
$query_data[] instead.
- Original Message -
From: "Kurt Lieber" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 25, 2001 1
Trying using mysql_fetch_array, and using the field names. This is the
recommended behaviour in PHP4:
$result = mysql_query($myQuery) //$myQuery gets defined earlier
$resultCount = mysql_num_rows($result);
$companyID = array();
while($query_data = mysql_fetch_
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();
wh
6 matches
Mail list logo