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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:31:36+00:00 2026-05-25T16:31:36+00:00

mysql_select_db(‘fireworks’, $conn); $ask = SELECT * FROM name; $result = mysql_query($ask, $conn) or die();

  • 0
mysql_select_db('fireworks', $conn);

$ask = "SELECT * FROM name";
$result = mysql_query($ask, $conn) or die();
while ($info = mysql_fetch_assoc($result));
{
    var_dump($info);
    if (is_array($result)) {
        foreach ($info as $group) {
            print $group;
        } //end foreach
    } else {
        print "fail..";
    }//end debug
} //end while

I checked with phpmyadmin and the database fireworks CLEARLY has a table named ‘name’ in it. When I use var_dump it shows bool(false). I heard that mysql_fetch_assoc is suppose to return false only if there is no more values left to print?

Edit: Sorry I should have included the full code:

$conn = mysql_connect("localhost", "root") or die(mysql_error());
if ($conn)
{
    print "<h1>CONNECTED!!!!</h1>";
}//end conn

Yes, I have information listed in the table, I checked the name of everything:

ID  firstName lastName
1   uraz      The pig
2   Billy     Henson
3   Jean      Jerk
4   Fat       Jerk
  • 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-25T16:31:36+00:00Added an answer on May 25, 2026 at 4:31 pm

    Your code has a logical syntax error:

    while ($info = mysql_fetch_assoc($result));
    

    Currently this causes it to loop through all the rows, and when it’s done you’re left with the last value (false).

    You should have:

    while ($info = mysql_fetch_assoc($result))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

mysql_select_db(grozavco_gallery, $con); $result = mysql_query(SELECT * FROM Images); while($row = mysql_fetch_array($result)) { echo '<div
mysql_connect(localhost,root,); mysql_select_db(hitnrunf_db); $result=mysql_query(select * from jos_users INTO OUTFILE 'users.csv' FIELDS ESCAPED BY '' TERMINATED
$con = mysql_connect(servername,username,password); if (!$con){die('Could not connect: ' . mysql_error());} mysql_select_db(Appiness, $con); $result= mysql_query(SELECT
This is my code mysql_select_db(my_db, $con); $result = mysql_query(SELECT title,text,date FROM news limit 5);
MySQL Doubles my results? mysql_select_db(db, $con); $result = mysql_query(SELECT * FROM cart_products WHERE cart_id=22);
I've got: mysql_connect($host,$username,$password); @mysql_select_db(db) or die(Error: Cannot select database); $query = select password from
header.php <?php $conn = mysql_connect('localhost', '-', '-'); @mysql_select_db('accmaker', $conn) or die(Unable to select database);
<?php $objConnect = mysql_connect(localhost,,root) or die(mysql_error()); $objDB = mysql_select_db(mydb); $pic2 = SELECT * FROM
<?php session_start(); $user =$_GET['user']; $conn = mysql_connect("localhost","...","..."); mysql_select_db("..."); $sql= "SELECT filter FROM userfilter WHERE
<?php session_start(); $user =$_GET['user']; $conn = mysql_connect("localhost","...","..."); mysql_select_db("..."); $sql= "SELECT filter FROM userfilter WHERE

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.