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

DOMDocument parsing
Hello, I am parsing an xml file from an API which I have converted into a DOMDocument in php. This i

php/mysql problem
Hey all,

Problem: im trying to setup a shop where people can use a drop-down list to select t

button help
i originally had this but realised it is much easier to have a button.

Code: <?php

How to clone an SAP ECC using bacup tape on z/os?
We want to clone our production to a different SID using backup tape.

Linking with Foreign Keys
I have been getting an erro when I try and link:

create table Faculty_Specialty (I_Name v

Problem with PHP code- simple contact form
I'm relativily new to PHP; I know HTML and CSS stuff but I have a problem- I have a contact form wit

Uploading/Downloading files stored in MySQL database
Hey all,

This problem just came up in my website and I'm having a hard time figuring out what

File upload issues
Hi Guys,

Can anyone see any issues with this code:
Code: $setImage= 'productimages/' . dat

PHP Login
Hey!
I got this shopcart code online, am trying to modify it but am getting an error when i try a

problems with contact forms that are only protected against SQL injections
What could be a potential problem with contact forms that are only protected against SQL injections

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