Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ID | emailaddress | password
- 1 | dummy@email.com | DUMB1PASS
- 2 | second@email.com | DUMB2Pass
- $email = "dummy@email.com";
- $servername = "correct"; $username = "correct"; $DBpass = "correct"; $dbname = "correct";
- $conn = new mysqli($servername, $username, $DBpass, $dbname);
- if ($conn->connect_error)
- {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "SELECT emailaddress FROM registration WHERE emailaddress = '$email'";
- $result = $conn->query($sql);
- if ($result->num_rows > 0)
- {
- echo "we found a match";
- }
- else
- {
- echo "we did not find a match";
- }
- $email = "dummy@email.com";
- $servername = "correct"; $username = "correct"; $DBpass = "correct"; $dbname = "correct";
- $conn = new mysqli($servername, $username, $DBpass, $dbname);
- if ($conn->connect_error)
- {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "SELECT password FROM registration WHERE emailaddress = '$email'";
- $result = $conn->query($sql);
- if ($result->num_rows > 0)
- {
- echo "the value is '$result'";
- }
- else
- {
- echo "we did not find a match";
- }
- Catchable fatal error: Object of class mysqli_result could not be converted to string in MYPAGE on line XX.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement