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 7593245
In Process

The Archive Base Latest Questions

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

So, I am really balls confused here. I have no idea what I’m doing,

  • 0

So, I am really balls confused here. I have no idea what I’m doing, but, I’m trying to restrict searches based on networks being either private or public.

This code does not work, but, I’m trying to figure out how to make this work. How do I make private networks only appear to people in that network????????????????

    $query = mysql_query("SELECT * FROM requests ORDER BY dateposted DESC");

while ($row = mysql_fetch_assoc($query)){

    $network = mysql_query("SELECT * FROM network");

    while ($row2 = mysql_fetch_assoc($network)) {
        $display = false;
        $pos = strpos($row['network'], $search);
        if ($row2['visible'] == "public" and $search == "Global") {
            $display = true;
        } else          
        if ($pos == true and 
        ($row2['visible'] == "public" or $row2['username'] == $username)) {
            $display = true;
        } else
        if  ($row2['visible'] == "private") {
            $display = false;
        }
    }
        echo $display;
        if ($display == true){
            echo "<div id='".$row["id"]."' class='item'>";
            echo '<div style="width: 75%;">';
            echo "<h4 style='display: inline;'>".$row["user"]." requests:</h4><br/>";
            echo "<h2 style='display: inline;'>".$row["title"]."  </h2>";
            echo '</div>';

            echo '<h3 id="button" style="border-radius: 10px; padding: 4px; color: white; float: right; position: relative; top: -50px; border: 2px solid grey; background-color: #C0504D;">Apply</h2>';
            echo "</div>";
        }
}

The network schema:

network text    utf8_general_ci     No                                   
username    text    utf8_general_ci     No                                   
visible text    utf8_general_ci     No  

The requests schema:

id  int(11)         No      auto_increment                          
user    text    utf8_general_ci     No                                   
title   text    utf8_general_ci     No                                   
description text    utf8_general_ci     No                                   
picture text    utf8_general_ci     No                                   
price   text    utf8_general_ci     No                                   
premium datetime            No                                  
type    text    utf8_general_ci     No                                   
network text    utf8_general_ci     No                                   
dateposted  datetime            No  
  • 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-30T21:07:16+00:00Added an answer on May 30, 2026 at 9:07 pm

    It’s a little bit late here, so I will try to better write this answer.

    You need to print all public networks, and only private networks related to the user. Also, if I understood, your search can be “Global” or have a part name of a network, correct?

    So your query can be something like this:

    if( $search == "Global" ) {
      $sql = "select n.*
                   , r.* 
                from network n
               inner join request r on n.network = r.network
               where  n.network = 'public' 
                  or (n.network = 'private' 
                 and  n.username = '".$username."')";
    } else {
      $sql = "select n.*
                   , r.* 
                  from network n
                 inner join request r on n.network = r.network
                 where  n.network = 'public' 
                    or (n.network = 'private' 
                   and  n.username = '".$username."')
                   and n.network like '%".mysql_real_escape_string($search)."%'";
    }
    

    The like here means “select me all data where the network name contains the content of search. You can see more examples and explanations here and in the mysql docs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to calculate new velocities for 2 colliding balls, but can't really do
I am really new at Perl and have been trying to piece together a
Really puzzled on this, probably simple but it is the day after New Years.
Really stuck on trying to write code to unzip a file or directory on
Really stupid question, sorry, but I can't find it on google (I'm sure it's
Really ripping my hair out on this one. I have a JAAS Authentication Provider
Really quick jQuery question... I have this function: $(document).ready(function() { $('a#show1').click(function() { $('.item1').toggle(1000); return
I am trying to learn Spring and Hibernate and i am really struggling to
First of all, my question isn't really specific to C# or XNA, but my
I am trying to create my first game for android. I currently have a

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.