mysql_fetch_assoc and extract
| From: | John Kaspar | Date: | Fri, 11 Apr 2003 20:33:25 +0000 |
| Subject: | mysql_fetch_assoc and extract | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-143785@lists.php.net to get a copy of this message | ||
Using extract after using mysql_fetch_assoc is handy for variables, but if no row if returned, you've got a problem. First you get an error on the extract needing an array, then you've got the same variables from the previous loop.
It would be very handy if extract could do a complete prefix unset first. For example, if my prefix were "my", it would unset every last variable starting with $my_ . And it would also not return an error on empty.
Or if that's asking for too much, having a wildcard unset would be awesome ... unset($my_*).
Anyone have a special function doing just that? Thanks.