Jump to content

with sql quary i get a blank page :S


runnerjp

Recommended Posts

hey guys... on on my index.php i have this code

 <?php 
if (isset($_GET['section'])) {
  $section = $_GET['section'];
} else {
  $section = 'main';
}
$file = "include/".$section.".php";
if (file_exists($file)) {
    require($file);
} 
?>

 

and this means the data gets added from the section... allworks ish lol

 

so when i got to main.php (code showm below) it will not show the data if my sql quary is there???

 

 

<?php
session_start();
require_once '../settings.php';?>
<?

$query = "SELECT * FROM users WHERE Username = '$username' LIMIT 1"; 
if ($result = mysql_query($query)){
    if (mysql_num_rows($result)) {
        $array = mysql_fetch_assoc($result);
        $pemail = $array['Email'];
        $puser = $array['Username'];
        $pid = $array['ID'];   
        $pfirst_name = $array['first_name'];  
        $plast_name = $array['last_name'];
	$pabout_me = $array['about_me'];
	$pevents = $array['events'];



        $sql = "SELECT `ext` FROM `user_images` WHERE `user_id`='$pid' LIMIT 1"; 
       ?>
<table width="100%">
  <tr>
    <td colspan="2"><div align="center">Welcome <?php echo $puser; ?> </div></td>
  </tr>
  <tr>
    <td colspan="2"> </td>
  </tr>
  <tr>
    <td width="50%"><a href="<?php echo get_username($_SESSION['user_id']);?>">MyProfile</a></td>
    <td width="50%"><a href="?section=uploader">change profile picture</a></td>
  </tr>
  <tr>
    <td colspan="2"> </td>
  </tr>
  <tr>
    <td colspan="2"> </td>
  </tr>
  <tr>
    <td colspan="2"> </td>
  </tr>
</table>

 

its strange because without

$query = "SELECT * FROM users WHERE Username = '$username' LIMIT 1"; 
if ($result = mysql_query($query)){
    if (mysql_num_rows($result)) {
        $array = mysql_fetch_assoc($result);
        $pemail = $array['Email'];
        $puser = $array['Username'];
        $pid = $array['ID'];   
        $pfirst_name = $array['first_name'];  
        $plast_name = $array['last_name'];
	$pabout_me = $array['about_me'];
	$pevents = $array['events'];



        $sql = "SELECT `ext` FROM `user_images` WHERE `user_id`='$pid' LIMIT 1"; 
       ?>

it shows the table and data but with it i get blank page :S

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.