I have the right idea. I am trying to display a profile image when the user logs in. I have a run time error. I have three different accounts set up. If I order the statment by User_Name, then I only get the ID of 2. If I order it by desc then I only get the ID of 3.. and so on and so forth. I am using two different naming conditions. mysql, and mysqli. I just need this to work as soon as possible. Here is my source code. Is their anyway to check for ID to equal the User_Name that I have within that mysql statment? Or is it more complex than I am thinking?
<?php
include "open_html.php";
include "htmlObody.php";
include "connect.php";
$query = mysqli_query($con, "SELECT User_Name FROM user");
$row = mysqli_fetch_assoc($query);
@setcookie("user", $row);
$conn = mysql_connect("localhost", "root", "");
mysql_select_db("info");
$query2 = "SELECT ID FROM user ORDER BY 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";
?>