|
Posted by Erwin Moller on 05/08/06 12:59
jantox@gmail.com wrote:
> Good day,
>
> We have some Java programmers in our software dev, and they are
> pressuring us to use Sessions to store data and use that Session to get
> query data. They say that it is ok since it is like Entities in Java. I
> am baffled as a .NET programmer, we tend to avoid using sessions and
> instead use DataSet, is there any equivalent of dataset in PHP?
Hi,
I would NOT advise storing a complete resultset in your session.
If you store it simply in your session, you store a resourceID, which is
unusable next invocation of any script using the same session.
You can however store an array-representation of the resultset in your
session.
If you use ADODB as a databaseabstractionlayer, you can do the following:
$res = $conn->Execute($SQL)->GetArray();
Beware however that big resultsets stored in session is asking for
performancetroubles.
Also, if you want to see your session:
<pre>
<? print_r($_SESSION); ?>
</pre>
Regards,
Erwin Moller
[Back to original message]
|