Click to See Complete Forum and Search --> : Why does this query return the wrong result?


ncblazek
05-28-2008, 11:41 AM
here is my query:
$sql = "select AddressID from `ALink` where (ALinkID=5 AND NameID=3)";

Here is the table it looks through


ALinkID AddressID NameID
1 1 1
2 2 1
3 3 2
4 4 2
5 5 3
6 6 3


This should return the result of 5, from the ALINKID row numbered 5. However, it returns the value of '6' from the row right after?

Anyone? Im clueless!

ncblazek
05-28-2008, 11:43 AM
The numbers are split into the 3 columns, but the formatting of the forum scrunched it, Im sorry.

ncblazek
05-28-2008, 12:59 PM
Nevermind...ugh I did this

if ($addressid1 = $addressid2) {
$addressid2 = 0;
}

instead of
if ($addressid1 = =$addressid2) {
$addressid2 = 0;
}

Problem solved!