Jump to content

Sql Problem...


xyn

Recommended Posts

Heya!
I've got my SQL problem, I have a Buddies request system,
When a member receives a new request they must accept or
decline the request, however I get told I have a request
when i don't...

The problem is it ignroes the SQL Query and takes the first option
ie: It selects * (all) from the database where User is "ash"

I want it to check if the buddy is a request or already accepted.

My code:
[code=php:0]$BrSql = mysql_query("SELECT * FROM pm_buddy WHERE bdy_name='{$_SESSION['username']['usr_user']}' AND inf_accept='0'") or die('Error: '.mysql_error().'');
            $BrNum = mysql_num_rows( $BrSql );
            if( !BrNum ){
            echo "";
            }else{
            echo "<tr>
  <td width=\"100%\" class=\"text\">X <a href=\"./index.php?x=buddy.requests\">New Buddy Requests</a></td>
</tr>";
            }[/code]
Link to comment
https://forums.phpfreaks.com/topic/21650-sql-problem/
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.