RE: [PHP] Cleaning a resultset
| From: | Murray @ PlanetThoughtful | Date: | Thu, 08 Sep 2005 13:34:52 +0000 |
| Subject: | RE: [PHP] Cleaning a resultset | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-222022@lists.php.net to get a copy of this message | ||
> Hi,
>
> I have a resultset from a query and need to remove some rows after doing
> some php processing then insert into another table i.e.
>
> /** Get data**/
> $qid = mysql_query('SELECT ...);
>
> /** Clean data **/
> while( $r = mysql_fetch_object( $qid ) ) {
>
> }
>
> How can i generate a new resultset / remove data from the existing
> resultset
> using this method?
>
> Thanks for your help
Hi Shaun,
Basically while iterating thru the resultset in $qid, test / cleans the data
row by row, and perform an INSERT query for each row within your while loop
that you want to be inserted into your other table.
Hope this helps.
Much warmth,
Murray
---
"Lost in thought..."
http://www.planetthoughtful.org