array
| From: | Jeremy Morano | Date: | Mon, 24 Sep 2001 15:23:11 +0000 |
| Subject: | array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-68533@lists.php.net to get a copy of this message | ||
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.