Search Results

Search found 2 results on 1 pages for 'user1174762'.

Page 1/1 | 1 

  • Understanding Nested If.. Else statements

    - by user1174762
    For some reason my PHP login script keeps returning "invalid email/password combination", yet i know I am entering the correct email and password. Does anyone see what I might be doing wrong? <?php $email= $_POST['email']; $password= $_POST['password']; if (!empty($email) && !empty($password)) { $connect= mysqli_connect("localhost", "root", "", "si") or die('error connecting with the database'); $query= "SELECT user_id, email, password FROM users WHERE email='$email' AND password='$password'"; $result= mysqli_query($connect, $query) or die('error with query'); if (mysqli_num_rows($result) == 1) { $row= mysqli_fetch_array($result); setcookie('user_id', $row['user_id']); echo "you are now logged in"; } else { echo "invalid username/password combination"; } } else { echo" you must fill out both username and password"; } ?>

    Read the article

  • PHP MySQL query string

    - by user1174762
    I am newer to PHP and MySQL and I am having trouble understanding join. I think, for me, the problem lies with actually understanding the logic of the query. What I am trying to do Is select all of the status updates from a table named "post", but only ones from users I am "following", and then display them In order by date. So, I have two databases which are set up like so: posts |post_id|user_id|post_body|date_upload| | 1 | 4 | hey. | 01/2/2012 | follows |relation_id|user_id|followee_id| | 1 | 4 | 2 | Could someone please explain how I should syntactically and Logically set this up? Thank you!

    Read the article

1