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

Having a problem get the selected item from a drop down menu
I have been looking at this for days now.

I have a drop down menu that get it's values from a

add to sql result
ok see rite now my sites hit counter is counted from the mysql visitor log i need to clear it aft

help with insert
Hi there,

I am trying to insert some data into a database, but for some reason, it is not ins

Rss feed question
Hi

My blog and my website are different. Am i able to take my rss feed
from my blog and p

Parse error: syntax error, unexpected $end in
hello,
i receive the error :Parse error: syntax error, unexpected $end in C:xamppxampphtdocsh

Undefined offset
The following script checks to see if the user answer matches the correct answer.

Form Fiel

How to get exact 3 moths post date from today date using javascript
How to get exact 3 moths post date from today date using javascript
Please help

Multiple Do / While Statements?
I'm still very new to PHP, and running in to a problem when trying to execute a do/while loop inside

Email Form Syantax Issue 2
How to make this look FROM:"OUR TEAM" instead of FROM:abc@mail.com

$headers = "

Values disappear from my array :( HELP!
hey all, I have a lil mysql/php/apache script that queries a database
and pulls put 5 integers.

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