Page 1 of 1

ID returns more from table than the ID...

Posted: Sun Oct 26, 2014 4:58 pm
by orbdrums
Hello all,

I have an ID field in a table, let's say it returns 1, but when I use conditional logic to compare, it returns true if the ID is IN the field instead of an exact match. Is there a PHP function that will compare the ID, in this case 1, to ONLY those records in the table that are 1? I am getting 12, 13, 14, etc...

Thanks in advance.

Re: ID returns more from table than the ID...

Posted: Sun Oct 26, 2014 7:20 pm
by Christopher
I am not clear whether you are talking about PHP (e.g., $ID == 1) or SQL (e.g., SELECT * FROM foo WHERE ID=1). Can you clarify and post some code?

Re: ID returns more from table than the ID...

Posted: Mon Oct 27, 2014 12:41 am
by orbdrums
$id == `mbr__id'`;

$id = 'member_id;

?

What is the difference?

Re: ID returns more from table than the ID...

Posted: Mon Oct 27, 2014 7:02 am
by Celauran
orbdrums wrote:What is the difference?
orbdrums wrote:$id == `mbr__id'`;
Comparison
orbdrums wrote:$id = 'member_id;
Assignment.

Your question still isn't terribly clear.

Re: ID returns more from table than the ID...

Posted: Sat Nov 01, 2014 2:03 am
by orbdrums
Thanks for explaining the difference between = and ==. That is what I needed! Very much appreciated.