views:

36

answers:

2

Can I modify the result that I have received from mysql_query than reset the pointer with mysql_data_seek($result, 0) and process the output like from normal query

Dummy example:

$result = mysql_query($query);
while($row = mysql_fetch_array($result)){
   $row[$fieldName] = $this->someFunction($row['id']);
}
mysql_data_seek($result, 0);

In current example it doesn't works. The changing that I made to $row doesn't save. Is it possible to realise such idea, about changing $result?

+1  A: 

You need to make a whapper around $result to make such things. But i advice you to change your minnd about why do you need it. There should be better way

bobrik
It will be great if you will describe how to do this wrapper.In other way I need to change "tons" of others code :(
andrii
+1  A: 

It would be possible if you'd used e.g. PDO. But with the "old" mysql extension? No, not the way you most likely want it to work.

VolkerK