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

Backflush
I am looking for a report in SAP that would give me a list of all parts that are populated with a ba

array_combine() trouble w/csv file
I have a problem with a piece of code I wrote to import some records from a csv file into mysql. I h

Looking for help reading a .txt or .ini file and outputting the info.
I have a file called Info.ini and It has the following info:
Code: [General]
Online=0
I wou

form variables from database help.
Hi all,

I would like to have a form that gives you options based on the results of an mysql q

GET vs SUBMIT Button to show sections on one index.php page?
Just curious if one of these ways is better (i.e. more efficient) than the other.

I have a

Email/MMS to Site
Hey guys. I'm looking for a way for a user to upload images and/or text via their cell phones. It

Array question
Does anyone know how to create a program that takes the $ amount for 8 different departments and gi

"SEO" URLs
Hey, I'm wondering how to go about creating and using these types of URLs. I'm presuming it's PHP th

Can we convert non uni code system into unicode
Hi All,

Presently i am using non-unicode system and the sap version is 4.7.
Can i c

for some reason mysql query not working, not inserting, please check it out
This code is not inserting anything into my db, don't know why, the $_SESSION variable does contain

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