I am using a php embedded mysql query as follows:
$query_sample = mysql_query("
SELECT left FROM sampleTable WHERE right = 1
UNION
SELECT right FROM sampleTable WHERE left = 1
");
where both the "right" and "left" columns are integers.
After this query is executed I want the result set to be assigned into an integer array in php. Is there an effecient approach to converting the results of a query into an integer array??
QUESTION:
I basically want to be able to ask the question: "Is $x in $results_array" after the results set from the query has been assigned to $results_array and $x is any integer.
Any help appreciated guys....
xis a column insampleTableyou should do this with SQL.xis a value you can test against a column insampleTableyou should do this with SQL.