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

phpmailer class & pop.gmail.com?
Code: <?php
$mail->IsSMTP();
$mail->Host = "pop.gmail.com";

Preventing blank or already entered values
Im trying to learn how to place a read file line by line and prevent duplicate entries and also BLAN

AutoChoosing a CSS file based on URL
Hey everyone,

I have a site that has multiple URLs and CSS files.

Based on the URL tha

Get to know your fellow coder
I think it's time we got personal around here. There's a lot of code swapping and a few members kno

Socket Server
In my following socket server, I am trying to listen to a connection through port 12345 in my web br

limit string by words??
hello all,

I was wonder if there is a function to limit a string by the number of words inste

upload form file types....
Hey all, I am learning PHP and I am writing a script from the W3C Schools tutorials for uploading fi

Appending GET data with form submition
Okay, what I'm trying to do is to use a form to append an already existing GET data string.

I

Remove Rows From Database ad
Hi All,

I have this:

Code: [Select]<?php
session_start();
include('../com

storing video files into mysql in php
hi

i have my video files in my folder ,
i have to store the path of the videos into db an

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