I've got an array that was passed from another page. I am wanting to query my mssql database for each of the items in the array. I am able to print the individual items to the a page but when I get into building the select statement I run into trobules.
This works:
for ($i=0; $i<count($lea_array);$i++) {
$str .= $lea_array[$i]."<p>";
}
print_r($str)
But when I try and use the same idea with a select statement i'm getting a query error:
$query1 = "SELECT * FROM School_Districts WHERE LEA =" .$lea_array[i];
$result1 = mssql_query($query1);
$district =mssql_fetch_array($result1);
Basically, I'm trying to query the database for all the items in the array and showing a field from a selected record like:
while ($district =mssql_fetch_array($result1) {
print_r($district['NAME']);
}
Any help would be great.