I asked a question earlier and a user stated that it looks like i'm oddly mixing the OO and procedural style usage of mysqli and that I should stick to either one or the other.
Can some one show me exactly what is wrong with my code and how my code should look like in OO and procedural form. I'm kind of curious now since the code I have seems to work for me, but then again I'm fairly new to PHP and MySQL and would like to learn the correct way.
Here is the code.
// Query member data from the database and ready it for display
$mysqli = new mysqli("localhost", "root", "", "sitename");
$dbc = mysqli_query($mysqli,"SELECT users.*, categories.*, users_categories.* FROM users_categories INNER JOIN users ON users_categories.user_id = users.user_id INNER JOIN categories ON users_categories.category_id = categories.id WHERE users_categories.user_id=3");
if (!$dbc) {
// There was an error...do something about it here...
print mysqli_error($mysqli);
}