Can anybody tell me what's wrong with the following code ---
for($i=0; $i<count($strnamearray); $i++){
echo $strnamearray[$i]."<br />";
$cordcquery = "SELECT `lat` , `lng` FROM `traffic` WHERE `strname` = '{$strnamearray[$i]}' LIMIT 0 , 30;";
$cordresult = mysql_query($cordcquery);
if (!$cordresult)
{
die('Invalid strncquery: ' . mysql_error());
}
while($cordrow = @mysql_fetch_assoc($cordresult)){
echo $cordrow['lng'].",".$cordrow['lat'];
echo "<br />";
}
}
Here $strnamearray[$i] is an array which contains some name. there is no error showed after executing this php code. But the problem is i am not getting my desired output...
mysqli
overmysql
, just a change of interface. Not all code is OOP, nor should it always be.