Hi there, I am getting weird error on my site. the error is above in the subject and here is the code:
code:
function get_username($user_id){
$query = "select * from registered_users where id=".$user_id;
$result = mysql_query($query);
--> if(mysql_num_rows($result) == 1){
$row = mysql_fetch_array($result);
if($row['display_real_names']=="N"){
return $row['username'];
}else{
if($row['m_initial']==0){
$row['m_initial'] = "";
}
$name = $row['f_name']." ".$row['m_initial']." ".$row['l_name'];
if(trim($name)==""){
return $row['username'];
}else{
return $name;
}
}
}else{
return "-NA-";
}
}
the error stems from the line marked with the -->
Thanks in advanced!
code:
function get_username($user_id){
$query = "select * from registered_users where id=".$user_id;
$result = mysql_query($query);
--> if(mysql_num_rows($result) == 1){
$row = mysql_fetch_array($result);
if($row['display_real_names']=="N"){
return $row['username'];
}else{
if($row['m_initial']==0){
$row['m_initial'] = "";
}
$name = $row['f_name']." ".$row['m_initial']." ".$row['l_name'];
if(trim($name)==""){
return $row['username'];
}else{
return $name;
}
}
}else{
return "-NA-";
}
}
the error stems from the line marked with the -->
Thanks in advanced!
Comment