Yesideez Posted April 19 Share Posted April 19 (edited) It's been many years since I did any of this stuff and just getting back into it. I did think of posting this in the mysql section but it's more of a code problem. I have the following... $db=new mysqli(host,username,password,database); $sql="SELECT * FROM users WHERE username=? AND password=?"; $stmt=$db->stmt_init() That last line where I call $db->stmt_init() I get an empty browser - absolutely nothing where I should have a load of HTML appear. I have written the rest (just in case it matters) which is: if ($stmt->prepare($sql)) { $stmt->bind_param("ss",$uname,$pword) $stmt->execute(); $stmt->fetch(); echo "id: ".$id."<br>Added: ".$added."<br>"; $stmt->close(); } Edited April 19 by Yesideez Quote Link to comment https://forums.phpfreaks.com/topic/320053-new-to-mysqli/ Share on other sites More sharing options...
Solution dodgeitorelse3 Posted April 19 Solution Share Posted April 19 I think you need a semi colon at end of $stmt=$db->stmt_init() $stmt=$db->stmt_init(); Quote Link to comment https://forums.phpfreaks.com/topic/320053-new-to-mysqli/#findComment-1621855 Share on other sites More sharing options...
Yesideez Posted April 19 Author Share Posted April 19 Correct - Noticed that just after I posted it and couldn't figure out how to delete my post. I missed another later on as well. For some reason it gives me error messages but I don't get error messages when I miss a semi-colon 😕 Quote Link to comment https://forums.phpfreaks.com/topic/320053-new-to-mysqli/#findComment-1621858 Share on other sites More sharing options...
Barand Posted April 19 Share Posted April 19 If you miss a semi-colon then no code runs because of the syntax error. It doesn't get as far as any errors that may occur. (set "diplay_startup_errors" ON in your php.ini file to be informed of any syntax errors. Post your error messages - it helps us. Quote Link to comment https://forums.phpfreaks.com/topic/320053-new-to-mysqli/#findComment-1621862 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.