Why is this query failing?


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

Why is this not working?
$query = "SELECT * FROM `users` WHERE `userid` = " . $USERID AND `pin` = " . $PIN;
$result = mysql_query($query)
or die("Web site query failed");

When I all I have is:
$query = "SELECT * FROM `users` WHERE `userid` = " . $USERID;
$result = mysql_query($query)
or die("Web site query failed");

It does work. But when I ad the PIN, it just fails. I have the variable $PIN assigned and I have a field called pin.

Thanks

No comments posted yet

Your Answer:

Login to answer
252 Like 43 Dislike
Previous forums Next forums
Other forums

ereg_replace()
Basically what i need to do is

$title = "This Suck's"

$striped = ereg_repl

issues verifying if user is logged in
I am having issues when a user logs in via asp Login control, the IsAuthenticated still seems to com

Better Method of a Member Cloud
I assume most people know how tag clouds work, where the tags most used are bigger and the least use

About imagecopyresampled()
Hello,

I am looking to use this function to resize parts of an image to a fixed thumbnail siz

Count number of records in all the tables with a querry URGENT PLEASE...
I downloaded ORACLE 9I DATA DUMP into my comp. There are number of tables. I need to find out the

PHP & MS Access - Line Break
Hey Guys!

I'm pulling records from an MS Access database and listing them using PHP and I'm r

How to schedule the a job?
Hi,
I have prepared a task ( i.e. a procedure is prepare the file and send the same to con

Adding Outlook 2007 items via file upload
I am looking for a way to be able to attach an Outlook item (an email message) in an ASP.NET 3.5 app

Line break?
Hi, I'm new to the forum and new to php. I'm not sure if I'm using the correct terminology so here i

frame help
on the bottom frame is menu.html

Code: <body><form action='link.php' met

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