You're problem is not in the printing, but in the selecting. I don't recommend the way you've done the whole thing.
for ($count = 1; $row = mysql_fetch_row ($result); ++$count)
{
$url_array[$count] = addslashes($row[0]);
}
In this code you are basically saying "use column 1 of the database and store it in the array. Column 1 is first, if you were using mysql_fetch_array or mysql_fetch_assoc then you would've had $url_array[$count] = addslashes($row['firstname']). If you want to have a full result array then I think this is what you should do.
- Code: Select all
while ($row = mysql_fetch_assoc($result)) {
$url_array[] = $row;
}
This will mean you have things like $url_array[0]['firstname'] or in your foreach you could have this in your printing code.
- Code: Select all
foreach ($url_array as $row) {
print $row['firstname']; //Prints first name
print $row['lastname'];
print $row['usrurl'];
}
Do you get the picture? Alternatively you could combine you're selecting and display functions and use this code, but of course something how you want.
- Code: Select all
while ($row = mysql_fetch_assoc($result)) {
print $row['firstname']; //Prints first name
print $row['lastname'];
print $row['usrurl'];
}