Yes, I think Strider64 is correct.
Also, Kelvinejimogu, this is from the other post where you were trying to use the deprecated MySQL code.
I was wondering if you are using a server or your local machine. Do you already have the database set up
on the server or local system?
This is how I do it on one site that uses MySQLi…
[php]
// Connecting to your database
$db_connect = mysqli_connect($hostname, $username, $password, $dbname);
// Check if connection was actually made
if (mysqli_connect_errno()) { echo "Failed to connect to the user database system! Error: " . mysqli_connect_error(); }
[/php]
Note that it uses the connect_errno not the mysqli error… It seems to make a difference on some servers.
This version checks for errors and if any displays it.
And, for the query, it is basically like this:
[php]
$query = “SELECT * FROM users WHERE id =” . $_POST[“user_id”];
$results = mysqli_query($db_connect, $query) or echo “Error selecting users from database!
” . mysqli_error($db_connect);
[/php]
Note that I am using $db_connect not $link, but, the rest is easy to understand…