GumSlone way is a better way of doing it, however here is another way:
However i think the real problem here is the mysql array is being edited by thunderwap to:
(Original post says: $web=explode(",",$uipadd); )
when it should be like this edited version:
PHP Code:
$uipadd = mysql_fetch_array(mysql_query("SELECT ipadd FROM siteusers WHERE id='".$who."'"));
$ip = preg_split("/[,]+/", $uipadd[0]);
echo "<center><b>Ip:</b> <a href="lists.php?action=byip&who=$who">$ip[0]</a></center>";
However i think the real problem here is the mysql array is being edited by thunderwap to:
PHP Code:
$uipadd = mysql_fetch_array(mysql_query("SELECT ipadd FROM siteusers WHERE id='".$who."'"));
$arr = explode(',',$uipadd); //returns the first object of the mysql array which is the dual ip address
$ip = $arr[0];
echo '<center><b>Ip:</b> <a href="lists.php?action=byip&who='.$who.'">'.$ip.'</a></center>';
when it should be like this edited version:
PHP Code:
$uipadd = mysql_fetch_array(mysql_query("SELECT ipadd FROM siteusers WHERE id='".$who."'"));
$arr = explode(',',$uipadd[0]); //The mysql array now has array index number :D (or could have stuck to gums original way with the array name)
$ip = $arr[0];
echo '<center><b>Ip:</b> <a href="lists.php?action=byip&who='.$who.'">'.$ip.'</a></center>';
Comment