I can't see where any element of $link is set in the second piece of code. I
assume they are separate examples. In the second example I would expect
$link[$c] to always be empty.
Tim Ward
----------
From: Jeremy Morano [SMTP:[EMAIL PROTECTED]]
Sent: 24 September 2001 16:23
To: [EMAIL PROTECTED]
Subject: array
Hello everyone.
I'm encountering difficulties using my arrays.
while ($row = mysql_fetch_array($result)) {
$link[$c] = $row['link'];
$c = $c + 1;
}
This is where I try using it.
while ($row = mysql_fetch_array($result)) {
$date = $row['date'];
$path = $row['path'];
$entry_name = $row['entry_name'];
$company_name = $row['company_name'];
$file = basename ($path);
while ($c >= 0) {
echo $link[$c];
if($file == $link[$c])
{
$file = "This is new";
}
$c = $c -1;
}
$contact_list2 .= "$date $file $entry_name $company_name\n";
}
Comment: The echo $link[$c] works fine. It displays what it
should.
However the if statement does not because $file and $link[$c] are
equal on
several occasions yet the content of $file doesn't change... Thank
You.
--
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]