Posted: Sat Apr 09, 2005 7:49 pm
Ok i see the prob.. I can't return the array and the contents if its put into a var.. it will not return or echo the var..
Any other ideas?
Any other ideas?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
function list_f() {
$sql = "SELECT f FROM users WHERE user='$name'";
$result = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_array($result);
$friends = $row['f'];
$list_friends = explode(',', $friends );
$string = "";
for ($i=0; $i<7; $i++)
{
$string .= $list_friends[$i].'<br />';
}
return $string;
}Code: Select all
function list_f($name)Code: Select all
function list_friends($name) {
$sql = "SELECT friends FROM users WHERE user='$name'";
$result = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_array($result);
$friends = $row['friends'];
$list_friends = explode(',', $friends);
for ($i=0; $i<7; $i++) {
$friends = $list_friends[$i];
}
return $friends;
}Code: Select all
function list_f() {
$sql = "SELECT f FROM users WHERE user='$name'";
$result = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_array($result);
$friends = $row['f'];
$list_friends = explode(',', $friends );
$string = "";
for ($i=0; $i >= count($list_friends); $i++)
{
$string .= $list_friends[$i].'<br />';
}
return $string;
}