mssql and resource handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a fairly common problem that I have not been able to find the
solution for in the documentation and FAQs. I have to access a MSSQL box
from a LAMP box using PHP. That part works fine (thank you freetds.org). I
need to display results from user queries 10 at a time with the basic NEXT
and BACK logic. I can use the mssql_data_seek function to move amongst the
record set. The problem is how do I save the results variable between web
page updates? I cannot save the record set variable in my session because it
always returns as zero. Consider the following code:

<?php
session_start();
include("localsettings.php");
$s = mssql_connect($Server, $User, $Pass) or die("Couldn't connect to SQL
Server on $Server");
mssql_select_db($SDB, $s) or die("Couldn't open database $SDB");
$sql="select * from products where prod_id='95038'";
$ress=mssql_query($sql) or die(mssql_get_last_message());
$_SESSION['ress']=$ress;
print $ress."\n";
$ress=$_SESSION['ress'];
print $ress."\n";
?>

The first time I print RESS is comes back as RESOURCE OBJECT #12, the second
time as 0. When I look in the session file, it is zero.

Help!

How can I pass this variable and its contents so they are usable to the next
web page?

Thanks in advance.

Michael

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux