Problem assigning value to variable in "IF" function


Posted on 16th Feb 2014 07:03 pm by admin

Does this script makes sense? I am trying to take the value that is set to "authenticat" and write it to authentication.

I think it is getting messes up by the $authenticat = "1" part.

Did you know?Explore Trending and Topic pages for more stories like this.
Thanks
function check_username_pin($USERID, $PIN)
{
$query="SELECT id FROM users WHERE ( userid = '$USERID' AND pin = '$PIN' )";
// dont return pin because of hackers
$result=mysql_query($query);
if(mysql_num_rows($result)>0)
{
$authenticat = "1"
}
$query="SELECT id FROM users WHERE ( useris = '$USERID' )";
// dont return pin because of hackers
$result=mysql_query($query);
if(mysql_num_rows($result)==0)
{
$authenticat = "2"; // bad id
}
$query="SELECT id FROM users WHERE ( pin = '$PIN' )";
// dont return pin because of hackers
$result=mysql_query($query);
if(mysql_num_rows($result)==0)
{
$authenticat = "3"; //bad pin
}
}

write("SET VARIABLE authentication $authenticat");
No comments posted yet

Your Answer:

Login to answer
308 Like 20 Dislike
Previous forums Next forums
Other forums

Mastering Regular Expressions, Third Edition, is available.
The Third Edition of Mastering Regular Expressions is available.

QuoteThis third edition is 5

please, need help coding this voting for your favorite car polling system.
hi, my code needs a lot of work, but i want to be able to let users vote on their favorite car, upda

php problem?
I don't think I'm stupid, but maybe I am.

I am working on a sit for a friend I am try to put

Array to string conversion
Can anyone help me with this?

Notice: Array to string conversion in /home/..../index.php on l

Multiple arrays inside data
Hi,

Simple question. I have a column called "array" in my database, and inserted in

cURL error
So here is my code... I got it off of here... http://www.youtube.com/watch?v=XcgQUsorF_8
Because

Syntax Help
Code:


im having trouble with that code snipped
Parse error: syntax error, unexpec

How many users online in the last 24-hours using time()?
I'm fairly new to PHP. I have a MySQL table called 'users' and a field called 'loggedin' which is in

IIS on 2003 anon access disabled issue
I have an IIS server that belongs to a domain, and anonymous access is turned off for all my sites.

Why does my php page download images over and over
Can anybody please explain to me why my php page keeps downloading the images and other items every

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash