Jump to content

[SOLVED] page taking forever to display .. i think i have a php db error


imarockstar

Recommended Posts

I have a page that returns a crap load of data but whenever I run this query .. .the page hangs .... should I OPEN and CLOSE the DB connection for each time i run a query ??

 

here is the page that is hanging ..

 

<? 
session_start(); 
if (isset($_SESSION['membersInfo']['username'])) { $pimp = "hellya"; }
else header("Location: index.php");
?>
<?php include("includes/head.php"); ?>
<?php include("includes/header.php"); ?>
<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ content start -->



<?php 
$userid = $_POST['userid'];

$sql="SELECT * FROM users WHERE userid = '$userid' ";
$result=mysql_query($sql);
while($rows=mysql_fetch_array($result)){;
?>

<? echo $rows['fname']; ?> <? echo $rows['lname']; ?> has answered the following portions of the application . <br>
Click on the set of questions to view the answer .

<?php } ?>

<?php 
$sql="SELECT * FROM gq_answers WHERE userid = '$userid' ";
$result=mysql_query($sql);
$count=mysql_num_rows($result);

if($count==1){ echo "General Questions"; }; 


?>


















<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ content end -->
<?php include("includes/footer.php"); ?>

 

 

when i take out this batch of code .. it loads fine ...

 

<?php 
$sql="SELECT * FROM gq_answers WHERE userid = '$userid' ";
$result=mysql_query($sql);
$count=mysql_num_rows($result);

if($count==1){ echo "General Questions"; }; 


?>

 

 

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.