I'm a total newbie when it comes to php and mysql/mysqli. I have this code and I get a PHP Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/byeroman/public_html/register.php on line 17. Here's the code:
$stmt = mysqli->prepare("SELECT COUNT(*) FROM users WHERE username=? LIMIT 1" or die($db->error()));
$stmt->bind_param("s", $username);
$stmt->execute();
$stmt->store_result();
$count=$stmt->num_rows;
$stmt->close();
if($count>0) exit();
what's wrong? thanks guys