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

Using Windows message as a Handle
Hi,

I am writing one of my first multithreaded programs.

In one of the thread,

Find only certain URLs from page ... regex (semi-complete script)
Hi guys,

What I need to do is take a page & extract all the URLs from the page &a

Time script, set to my time zone?
I am using this line to get the date and time

Code: $time = date(F." ".d.", &q

Drop Down and text box issue
Is it possible to set a drop down list and text boxes to a certain width?

here is my code

what does this mean? +=
is anyone able to explain what this code is saying?

i had it written for me awhile back and n

need a script for 3 pages
I have a customer who wants me to set up a site with a number of pages with the following requiremen

array_combine() error
getting an "Warning: array_combine() [function.array-combine]: Both parameters should have an e

Progress bar tracking file downloads
Hey guys, was wondering if there was a way to track how far a file has been downloaded. I know there

phpMailer not working ..........
HI,
I was playing with the phpMailer script and tried to send a smiple mail using their test scri

Web Application Recipe
Hi Guys!

I am working with the Web Application recipes. I am currently working on the sen

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