cruxaders Posted April 5, 2011 Share Posted April 5, 2011 When i try to run the page...i ddnt see anything...its just a plane white background.. is there a problem in my code <?php $con = mysql_connect ("localhost","root",""); if(!$con) { die ('could not connect:' . mysql_error()); } mysql_select_db ("users", $con); $username = "sample"; $sql = "SELECT * FROM `users` WHERE `id`='".username."'"; $res = mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_assoc($res)) { $imagename = $_FILES['image']['imagename']; $tmp_name = $_FILES['image']['tmp_name']; $location = "avatar/".$imagename; move_uploaded_file($tmp_name,$location); $avatar = mysql_query("SELECT imagelocation FROM `users` WHERE `id`='".$username."'")or die(mysql_error()); $row3 = mysql_fetch_assoc($avatar); $location = $row3['imagelocation']; echo"<table width=\"686\" height=\"178\" border=\"0\">"; echo"<tr> <td width=\"160\" height=\"30\">First Name</td> <td width=\"321\">" . $row['name'] . "</td> </tr>"; echo"<tr> <td height=\"31\">Email Address</td> <td>" . $row['email'] ."</td> </tr>"; echo"<tr> <td height=\"28\">Username</td> <td>" . $row['username'] ."</td> </tr>"; echo"<tr> <td height=\"30\">ProfilePic</td> <td> </td> </tr>"; echo"<tr> <td><table width=\"100\" border=\"0\" align=\"center\"> <tr> <td><img src =\"$location\" width=\"100\" hieght=\"100\"></td> </tr>"; echo"</table></td>"; echo"<td><form id=\"form1\" name=\"form1\" enctype=\"multipart/form-data\" method=\"post\" action=\"\"> <input type=\"file\" name=\"image\" id=\"image\" />"; echo"</form></td> </tr> </table>"; } mysql_close($con); ?> Quote Link to comment https://forums.phpfreaks.com/topic/232798-another-codegot-a-problemcan-someone-help-me-again/ Share on other sites More sharing options...
SamT_ Posted April 5, 2011 Share Posted April 5, 2011 On a new line after "<?php", add the following: error_reporting(E_ALL); Refresh the page and see if any errors come up. Quote Link to comment https://forums.phpfreaks.com/topic/232798-another-codegot-a-problemcan-someone-help-me-again/#findComment-1197430 Share on other sites More sharing options...
cruxaders Posted April 6, 2011 Author Share Posted April 6, 2011 still ddnt see anything no error..all white what should i do... Quote Link to comment https://forums.phpfreaks.com/topic/232798-another-codegot-a-problemcan-someone-help-me-again/#findComment-1197518 Share on other sites More sharing options...
kenrbnsn Posted April 6, 2011 Share Posted April 6, 2011 This line <?php $sql = "SELECT * FROM `users` WHERE `id`='".username."'"; ?> probably should be <?php $sql = "SELECT * FROM `users` WHERE `id`='$username'"; ?> Ken Quote Link to comment https://forums.phpfreaks.com/topic/232798-another-codegot-a-problemcan-someone-help-me-again/#findComment-1197575 Share on other sites More sharing options...
Pikachu2000 Posted April 6, 2011 Share Posted April 6, 2011 View ---> Source after loading the page and see if there is any html output being sent to the browser. Quote Link to comment https://forums.phpfreaks.com/topic/232798-another-codegot-a-problemcan-someone-help-me-again/#findComment-1197577 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.