By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,062 Members | 1,358 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,062 IT Pros & Developers. It's quick & easy.

Is this code correct

P: 16
can someone tell me if this code is correct i'm getting "not".
Expand|Select|Wrap|Line Numbers
  1. $query = "SELECT `id` FROM `users` WHERE `username`='$username' AND `password`='$passhash'";
  2.     if($query_run = mysql_query($query)) {
  3.             echo 'ok.';
  4.         }else{
  5.             echo 'not.';    
  6.         }
Jan 30 '12 #1
Share this Question
Share on Google+
2 Replies

Expert Mod 10K+
P: 12,366
= is the assignment operator, == is the comparison operator.
Jan 30 '12 #2

Expert Mod 5K+
P: 8,639
if there is a mysql error you can get it with mysql_error().
Jan 31 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.