requinix Posted December 12, 2020 Share Posted December 12, 2020 24 minutes ago, Daniii said: Output: SQL error 2- 1 (2) $sql = "SELECT * FROM users WHERE email = $email"; $stmt = mysqli_stmt_init($conn); if (!mysqli_stmt_prepare($stmt, $sql)) { echo 'SQL error 2'; $my = mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT); echo "- $my (2)"; exit(); Quote Link to comment https://forums.phpfreaks.com/topic/311847-problem-with-mysqli-password-reset-script/page/2/#findComment-1582998 Share on other sites More sharing options...
Daniii Posted December 12, 2020 Author Share Posted December 12, 2020 $email = $row['email']; $sql = "SELECT * FROM users WHERE email = $email"; $stmt = mysqli_stmt_init($conn); if (!mysqli_stmt_prepare($stmt, $sql)) { echo 'SQL error 2'; $my = mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT); echo "- $my (2)"; exit(); i don't see any difference between your code and mine @requinix Quote Link to comment https://forums.phpfreaks.com/topic/311847-problem-with-mysqli-password-reset-script/page/2/#findComment-1583001 Share on other sites More sharing options...
requinix Posted December 12, 2020 Share Posted December 12, 2020 There is no difference. I just posted the problematic code. For reference. Ideally you would take another look at it and realize what the problem is, but if not you, someone will. Quote Link to comment https://forums.phpfreaks.com/topic/311847-problem-with-mysqli-password-reset-script/page/2/#findComment-1583002 Share on other sites More sharing options...
Daniii Posted December 12, 2020 Author Share Posted December 12, 2020 okay thanks I still do not find any error Quote Link to comment https://forums.phpfreaks.com/topic/311847-problem-with-mysqli-password-reset-script/page/2/#findComment-1583003 Share on other sites More sharing options...
requinix Posted December 13, 2020 Share Posted December 13, 2020 Let me put it this way: Is $sql supposed to be a prepared statement or not? Quote Link to comment https://forums.phpfreaks.com/topic/311847-problem-with-mysqli-password-reset-script/page/2/#findComment-1583004 Share on other sites More sharing options...
Daniii Posted December 13, 2020 Author Share Posted December 13, 2020 yes i think is should be a prepared statement Quote Link to comment https://forums.phpfreaks.com/topic/311847-problem-with-mysqli-password-reset-script/page/2/#findComment-1583013 Share on other sites More sharing options...
Barand Posted December 13, 2020 Share Posted December 13, 2020 Then read this Quote Link to comment https://forums.phpfreaks.com/topic/311847-problem-with-mysqli-password-reset-script/page/2/#findComment-1583014 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.