MySQL获取数组警告[重复]

image for query

. . I m getting this Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocsambulalulintas\lokasi.php on line 22

</div>

This is very short response that would warrant an overly long explanation.

Basically, $tampil has come back as FALSE ( A Boolean ) and not a resource as the error message states.

So you probably have an error in your SQL.

A quick sanity check is to run your SQL statement directly in something like phpmyadmin as SQL under the SQL Tab or whatever you use to run SQL against your database and check it works/doesn't work.

Please use mysqli_xxx or PDO... mysql_xxx is outdated, deprecated, just don't use it.

There is more to be said but this isn't the time nor place to do that... I would strongly suggest you look up that error message in Google to see the vast amounts of discussion on this... Plus you might pick up some handy tips...