*sigh* @ultrilliam
This is what I got as an error: MySQLi Connection Successful Fatal error: Uncaught TypeError: mysqli_stmt_init(): Argument #1 ($mysql) must be of type mysqli, string given in C:\htdocs\skillfulstudy\includes\functions.inc.php:38 Stack trace: #0 C:\htdocs\skillfulstudy\includes\functions.inc.php(38): mysqli_stmt_init('userEmail') #1 C:\\htdocs\skillfulstudy\includes\signup.inc.php(25): uidExists('userEmail', 'userName', 'userPwd') #2 {main} thrown in C:\htdocs\skillfulstudy\includes\functions.inc.php on line 38 Lines 35-43 where it caught the error: ``` 35 ... 36 function uidExists($conn, $username, $email) { 37 $sql = "SELECT * FROM users WHERE usersUid = ? OR usersEmail = ?;"; 38 $stmt = mysqli_stmt_init($conn); 39 if (!mysqli_stmt_prepare($stmt, $sql)) { 40 header("location: ../signup.php?error=stmtfailed"); 41 exit(); 42 } 43 ... ``` $conn variable value (all connection values are accurate): ``` $conn = mysqli_connect($serverName, $dBUserName, $dBPassword, $dBName); ```
It says it throws a fatal error because `mysqli_stmt_init()` requires a mysqli type argument, but it does contain one...?
Went back through and found the error
I take that you weren't passing your connection through to $conn?
I had 2 variables swapped in places, so it was pulling the wrong information
Join our real-time social learning platform and learn together with your friends!