This code is supposed to get the user id from my database but it returns this : Resource id #6
So how would I code this to make it return the user id?Here is my code so far and I know that mysql_query is becoming outdated:
<?php
include("login_check.php");
include("dbconnect.php");
mysql_select_db("maxgee_close2");
$username = $_COOKIE['maxgee_me_user'];
$user_id = mysql_query("select user_id from users where username = '$username'");
echo "$user_id";
?>
mysql_*functions in new code. They were removed from PHP 7.0.0 in 2015. Instead, use prepared statements via PDO or MySQLi. See Why shouldn't I use mysql_* functions in PHP? for more information.