Thiemos Archiv
- Friday, 2014-07-18 14:10
- I'm working with MySQL databases in PHP projects for about 14 years now. You connect to the database server, select a default database, query a result set resource with
$result = mysql_query( 'SELECT column FROM table' )
and start fetching the rows with$row = mysql_fetch_assoc( $result )
in a loop.mysql_query
does not fetch the rows, right? That would be stupid, right? It can't know what you are going to do with the result, right? Wrong.mysql_query
fetches the rows. All of them. Which means usingmysql_num_rows
for everything with more than a few dozen rows is a stupid idea.
PHP, I love you, but you are still weird. Kommentare zu diesem Beitrag können per E-Mail an den Autor gesandt werden.