I'm experimenting with sessions and note that you seem to able pass a query
result id via an include but not via an <a href=...>. Is this correct or
have I got it wrong? Do I need to do something to $session[result] before
passing it via <a href>?  Example scripts:

session.phtml:
$connection = mysql_connect($DBHost,$DBUser,$DBPass);
mysql_select_db("$DB");
session_start();
session_register("session");
$session["result"]=mysql_query("select * from $TA");
$rows = mysql_num_rows($session[result]);
echo "Rows in session = $rows<BR>";
echo "<a href ='sessionrows.phtml?rows=$rows'>Pass</a><BR>";
echo "<a href
='sessionresultid.phtml?resultid=$session[result]'>Send</a><BR>";
include ("sessionresult.phtml");

sessionrows.phtml:
echo "<br> Rows in sessionrows = $rows";

sessionresultid.phtml:
$rows = mysql_num_rows($resultid);
echo "<br> Rows in sessionresultid = $rows";

sessionresult.phtml:
$rows = mysql_num_rows($session[result]);
echo "Rows in sessionresult = $rows<BR>";

Output from session.phtml reads:
Rows in session = 7
Pass
Send
Rows in sessionresult = 7

Clicking on Pass outputs "Rows in sessionrows = 7" as expected. But Clicking
on Send outputs the "Warning: Supplied argument is not a valid MySQL result
resource ..." error. I also get this when I click Back from either
sessionrows.phtml or sessionresultid.phtml. Again not sure why?

Any help gratefully received.

Mick Lloyd
[EMAIL PROTECTED]
Tel: +44 (0)1684 560224



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to