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

  • Home
  • SEARCH
  • 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 8975975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:00:50+00:00 2026-06-15T19:00:50+00:00

I did make a post previously but was not able to properly explain my

  • 0

I did make a post previously but was not able to properly explain my issue nor was I able to get it resolved. This is what I have.

$shoutlines = file($shout_file);

$aTemp = array();
foreach($matches['user'] as $user) {
    $aTemp[] = "'" . $user . "'";
}
$user = implode(",", $aTemp);

$rara = "SELECT * FROM accounts WHERE username IN ( $user )"; // Tried this statment both as a query and prepared statement
$getlevel = $db->query("SELECT * FROM accounts WHERE username IN '( ".$user." )'"); // Tried this both as a query and prepared statement
//$getlevel->bind_param('s', $user);
//$getlevel->execute();
//$level = $getlevel->get_result();
//$getlevel->store_result();
while($getdb = $getlevel->fetch_assoc()){
    //output the html
        for($i = 0; $i < (1000); $i++)
        {
            if(isset($shoutlines[$i]))
            {

                $shoutline = preg_replace('/<\/div>\n/', ' ', $shoutlines[$i], 1);
                echo showSmileys($shoutline) . "<div class='delete'><a href='javascript: delete_shoutline({$i});' title='Delele'>delete</a></div></div>";
            }
        }
}

I have a for loop within the while loop that will not run within it, if I move the for loop outside of the while it works fine, but I need it in the while loop to make checks of the users for post titles, abilities etc., that are saved in my database. I have shown what I have tried so far when to comes to identifying the problem, I have tried dieing out errors if the query, binds, or executes weren’t showing true, but got now hits. The code for this is pulled out so there isn’t too much clutter for your reading abilities, any help with this would be greatly appreciated.

  • 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-06-15T19:00:51+00:00Added an answer on June 15, 2026 at 7:00 pm

    When “exploding” the username, you need ot wrap each username in quotes, not the whole thing. Also make the names safe for data entry.

    $aTemp = array();
    foreach($matches['user'] as $user) {
        $aTemp[] = '"' . mysql_real_escape_string($user) . '"';
    }
    $user = implode(",", $aTemp);
    

    Then use the first query:

    "SELECT * FROM accounts WHERE username IN ( $user )";
    

    Edit: adding error checking:

    $getlevel = $db->query("SELECT * FROM accounts WHERE username IN ( $user )");
    if ($getlevel == false) {
        // Normally you'll build into a function or class, but this is the simple example
        // Never output SQL errors on a live site, but log to file or (if you can do it safely) the database.
        echo 'Whoopsie<br />';
        var_dump($db->errorInfo());
        exit();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry to be editing this once again, but rather than make another post, I
I'm trying to make a post, however each time I did it, I would
I did not make any changes on the code. I dont receive any errors
I did tons of methods to figure out how to make this mod rewrite
svn offer lot of nice commands that make us able to know what is/did
I tried to make my textbox type in currency format. I did it, but
The following method (in which I hopefully did not make any mistakes while dramatically
So I'm using this plugin: jquery-in-place-editor , I'm trying to make a POST request
I want to make a post request in Scala to this API http://api.atinternet-solutions.com/toolbox/reporting.asmx I
I have a problem wit a $.post request. No errors, but the return is

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.