Hello everyone.
I'm new here and to php!
I have this code in my 'check_exists.php' file:
<?php
$userID = $COOKIE['userID'];
$entity = $COOKIE['entity'];
$password = $_COOKIE['password'];
$row['user_first_name'] = $userID;
$row['user_last_name'] = '. Please complete this form to register';
$result = mysqli_query($link, 'SELECT * FROM users_table WHERE user_ID="' . $userID . '" And user_entity="' . $entity . '" And user_password="' . $password . '"');
if ($result) {
$row = mysqli_fetch_array($result);
}
echo 'Welcome ' . $row['user_first_name'] . ' ' . $row['user_last_name'];
?>
The first problem is that it only welcomes me the second time I enter existing user data. It feels like the mysqli_query doesn't finish before the rest of the code is executed!?
Secondly, $row gets cleared even when 'if ($result)' is false, so I never see 'Please complete this form to register'.
Please help me with these issues if you can.
Best regards
Chris