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");
Did you know?Explore Trending and Topic pages for more stories like this.

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

Agency Business Process
Hi,

I don’t understand the process of the agency business in SAP.

In my

Convert Binary String to Decimal
Trying to Get:
Decimal: 305419896

Out of:
Binary String: xV4

New Login Script
Hi all, i attempted to create a whole new login script witch isnt working for some reason i dont kno

email CODING Problem
Email coding problem.

I need to send a section of the info to $tf and the same as a Cc to $em

Displaying Column Names
I have a question regarding the ability to show the column names from my table/query.
What I'm lo

background color imagefill
Hello

I would like to ask you why I see this square in red color just in my local xampp insta

Image DPI
Hi.

I allow users to upload images, the user then is able to adjust several settings for the

default SAP userid
hi,, I just like to know if it is ok to use the default SAP user id (SAP*)?

Most basic form question ever?
Hello,

I want to use this snippet to make sure the fields in a form are ok before processing

Losing 'page' data
I have this code that allows me to update my database. But after updating, I lose the $_GET['page']

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