Jump to content

my mysql query doesn't show the correct row...


j152

Recommended Posts

For some reason, I can't display the right row in my mysql table.

I can connect to the database okay.

 

Problems I'm experiencing

- anything I type in the .html form will log me in

- the information being displayed is from the very first row in the DB

 

FUNCTIONS FILE THAT CONTAINS DB INFO

 

<?php	

include 'config.php';
$did=$_SESSION['loggedin'];


// Assign the Query
$sql="SELECT * FROM bes_library WHERE userid='$did'"; 


//Execute the Query
$result=mysql_query($sql);

if (!$result)
{
die ("Could not query the database: <br />". mysql_error());
}


// Fetch & Display Results Using Fetch Array | Left Column = Session Strings | Right Column = Database Columns
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$id			=$row["id"];
$use_id		 	=$row["userid"];
$refer			=$row["referreid"];
$up_id			=$row["upnid"];
$points			=$row["points"];
$max			=$row["max_points"];
$last_up			=$row["last_update"];
$ref_user			=$row["referraluser"];
$refee			=$row["referrees"];
$block			=$row["blocked"];
$birth			=$row["birthdate"];
$av			=$row["avatar"];
$level			=$row["levelrank"];
$lev_date			=$row["leveldate"];
}

mysql_close();
$i=0;
while ($i < $num) 

{
echo "<b>zip<hr><br>";
$i++;
}

?>

 

 

THIS FILE THAT SHOULD DISPLAY INFORMATION FROM DB

 

(I've removed the extra .html code)

 


<?php

session_start();
if 
(!(isset($_SESSION['loggedin']) && $_SESSION['loggedin'] != '')) 
{
header ("Location: user_registration.php");
}

include 'config.php';
include 'dfunctions.php';

echo "$id";
echo "$use_id";
echo "$points";
echo "$birth";
echo "$up_id";
echo "$last_up";

?>

 

Any help anyone might offer would be greatly appreciated!

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.