MySQL only returning one result. Im Baffled.

Posted by Tapha on Stack Overflow See other posts from Stack Overflow or by Tapha
Published on 2010-03-12T16:27:25Z Indexed on 2010/03/12 16:27 UTC
Read the original article Hit count: 151

Filed under:
|

Here is te code:

<?php

//Starting session

session_start();

//Includes mass includes containing all the files needed to execute the full script
//Also shows homepage elements without customs

require_once ('includes/mass.php');

$username = $_SESSION['username'];

if (isset($username))

{   

//Query database for the users networths

$sq_l = "SELECT * FROM user";

$sql_query_worth = mysql_query($sq_l);

while ($row = mysql_fetch_assoc($sql_query_worth))

      {

         $dbusername = $row['username'];


      } 

      echo $dbusername;

}
?>

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql