Hi guys sorry for asking too many questions lately.
I'm fetching database entries but my pages show incomplete output, here's the code
<?php
require 'inc/head.inc';
require 'inc/header.inc';
$_SESSION['search'] = mysql_real_escape_string(htmlentities(stripslashes($_POST['search'])));
$sql = "SELECT * FROM users WHERE nick = '{$_SESSION['search']}' OR sname = '{$_SESSION['search']}' OR fname = '{$_SESSION['search']}' OR city = '{$_SESSION['search']}' LIMIT 0, 10";
$query = mysql_query($sql, $con);
if(($rows = mysql_num_rows($query) < 1) || empty($_SESSION['search']))
print 'No one was found';
else
while($result = mysql_fetch_array($query))
{
print '<a href=user.php?nick='.$result['nick'].'>'.$result['nick'].'</a>';
if(!empty($result['sex']))
print ' : '.$result['sex'];
if(!empty($result['city']))
print ' : '.$result['city'];
if(!empty($result['country']))
print ' : '.$result['country'];
print '<br>';
}
require 'inc/foot.inc';
?>
It shows everything correctly except the country, instead of showing "South Africa" it displays "South"
