My page shows incomplete output please help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    My page shows incomplete output please help

    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 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"
    libra.wen.ru

    #2
    check your db, that is what is in your db

    Comment


      #3
      Try this.

      PHP Code:
                  $sql    =    "SELECT * FROM users WHERE nick LIKE '%".$_SESSION['search']."%' OR sname  LIKE '%".$_SESSION['search']."%' OR fname  LIKE '%".$_SESSION['search']."%' OR city  LIKE '%".$_SESSION['search']."%' LIMIT 0, 10"
      <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

      Comment


        #4
        Thanks guys now here's another problem, code
        PHP Code:
                                    if(empty($result['birthyear']))
                                        print    
        '<input type=text name=year size=4 maxlength=4 value=YYYY>';
                                    else
                                        print    
        '<input type=text name=year size=3 maxlength=4 value='.$result['birthyear'].'>';
                                    if(empty(
        $result['birthmonth']))
                                        print    
        '<input type=text name=month size=2 maxlength=2 value=MM>';
                                    else
                                        print    
        '<input type=text name=month size=1 maxlength=2 value='.$result['birthmonth'].'>';
                                    if(empty(
        $result['birthday']))
                                        print    
        '<input type=text name=day size=2 maxlength=2 value=DD>';
                                    else
                                        print    
        '<input type=text name=day size=1 maxlength=2 value='.$result['birthday'].'>'
        Here's output and my database
        Attached Files
        Last edited by s3nzo; 09.09.11, 21:40.
        libra.wen.ru

        Comment

        Working...
        X