php - Displaying Profile image after login -


i have right idea. trying display profile image when user logs in. have run time error. have 3 different accounts set up. if order statment user_name, id of 2. if order desc id of 3.. , on , forth. using 2 different naming conditions. mysql, , mysqli. need work possible. here source code. anyway check id equal user_name have within mysql statment? or more complex thinking?

<?php     include "open_html.php";     include "htmlobody.php";     include "connect.php";      $query = mysqli_query($con, "select user_name user");     $row = mysqli_fetch_assoc($query);      @setcookie("user", $row);      $conn = mysql_connect("localhost", "root", "");     mysql_select_db("info");      $query2 = "select id user order user_name";       $result = mysql_query($query2);     $row2 = mysql_fetch_array($result); ?>      <div>         <img src="user_file.php?id=<?php echo $row2['id']; ?>"/>         <br />         <?php echo $_cookie["user"]; ?>     </div>  <?php     include "htmlcbody.php";     include "close_html.php"; ?> 

my images not being echoed id names. query looks this:

    $sql = "select id, user_image, user_name user user_name = image_name"; 

make sure when user creates new user have user name equal image name. like:

$username = $_post["user"]; $userimage = $_post["user"]; $query = mysqli_query($con, "select * user insert user_name, user_image values ("username", "userimage")); 

that's not insert image database, make can correctly grab profile image. used this link upload images.


Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -