runnerjp Posted February 15, 2008 Share Posted February 15, 2008 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.