Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 791659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:52:24+00:00 2026-05-14T21:52:24+00:00

<?php $results = mysql_query(SELECT * FROM .TBL_SUB_RESULTS. WHERE user_submitted != ‘$_SESSION[username]’ AND home_user =

  • 0
        <?php
    $results = mysql_query("SELECT * FROM ".TBL_SUB_RESULTS."
                           WHERE user_submitted != '$_SESSION[username]' AND home_user = '$_SESSION[username]' OR away_user =   
                           '$_SESSION[username]'  ") ;
    $num_rows = mysql_num_rows($results);
        if ($num_rows > 0)
        { 
            while( $row = mysql_fetch_assoc($results)) 
            {
                extract($row);
                $q = mysql_query("SELECT name FROM ".TBL_FRIENDLY." WHERE id = '$ccompid'");
                while( $row = mysql_fetch_assoc($q)) 
                {
                    extract($row);
                ?>
                    <table cellspacing="10" style='border: 1px dotted' width="300" bgcolor="#eeeeee">
                    <tr>
                    <td><b><? echo $name; ?></b></td>
                    </tr><tr>
                    <td width="100"><? echo $home_user; ?></td>
                    <td width="50"><? echo $home_score; ?></td>
                    <td>-</td>
                    <td width="50"><? echo $away_score; ?></td>
                    <td width="100"><? echo $away_user; ?></td>
                    </tr><tr>
                    <td colspan="2"><A HREF="confirmresult.php?fixid=<? echo $fix_id; ?>">Accept / Decline</a></td>
                    </tr></table><br>
                    <?
                }


            }


        }
        else
        {
            echo "<b>You currently have no results awaiting confirmation</b>";
        }

    ?> 

I am trying to run two queries as you can see.
But they aren’t both working.
Is there a better way to structure this, I am having a brain freeze!
Thanks

OOOH by the way, my SQL wont stay in this form!
I will protect it afterwards

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T21:52:24+00:00Added an answer on May 14, 2026 at 9:52 pm
    SELECT  *
    FROM    TBL_SUB_RESULTS ts
    LEFT JOIN
            TBL_FRIENDLY tf
    ON      tf.id = ts.ccompid
    WHERE   ts.user_submitted != '$_SESSION[username]'
            AND ts.home_user = '$_SESSION[username]' OR ts.away_user = '$_SESSION[username]'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing XML results from an API call using PHP and xpath. $dom =
//check which faction members are online $sql = mysql_query(SELECT * FROM .TBL_ACTIVE_USERS. WHERE faction=$userfaction_id
I know how to do a regular php mysql search and display the results.
Consider the following code <?php $username = root; $password = ; $host = localhost;
I have a combo box. When I select a value from combobox, it prints
Im using the following PHP and MySql to fetch rows from a table, $search_word=$_GET['search_word'];
I have this simple php script <?php echo '<pre>'; // Outputs all the result
PHP has a great function called htmlspecialcharacters() where you pass it a string and
PHP's explode function returns an array of strings split on some provided substring. It
PHP, as we all know is very loosely typed. The language does not require

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.