Jump to content

Text value returning 0?


RaythMistwalker

Recommended Posts

Ok I have this code retrieving information from mysql:

 

if (isset($memid)) {
    $query_meminfo = "SELECT * FROM ".MEMBER_PROFILE_TABLE." WHERE `user_id`=".$memid;
    $query_result = mysql_query($query_meminfo, $db);
    $MemName = mysql_result($query_result, 0, 'display_name');
    $MemGroup = mysql_result($query_result, 0, 'Group');
    $LevelQuery = "SELECT group_level FROM ".MEMBER_GROUPS." WHERE group_id='".$MemGroup."'";
    $LevelResult = mysql_result(mysql_query($LevelQuery, $db), 0, 'group_level');
    $MemLevel = intval($LevelResult);
}

 

It is definitely retrieving the correct info as it is correctly checking member levels to display certain information.

 

Part 2 of code:

 

<table width="100%" id="userlinks" cellspacing="6">
    <tr>
        <td>Welcome
            <?php
            if (isset($MemName)) {
            Echo $MemName + " "; ?>
            (<a href="index.php?act=logout">Logout</a>
            <?php
                if ($MemLevel >= 9000) {
                    echo " | <a href='admin.php'>Admin CP</a>";
                }
            ?>
            )
            <?php
            }
            Else {
                ?>
            Guest (<a href="index.php?act=login">Login</a> | <a href="index.php?act=register">Register</a>)
            <?php
            }
            ?>
        </td>
    </tr>
</table>

 

For some reason, instead of displaying the person's display name it is just displaying the number 0.

Link to comment
https://forums.phpfreaks.com/topic/249742-text-value-returning-0/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.