session_register

From: Date: Mon, 03 Jul 2000 22:55:29 +0000
Subject: session_register
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-4624@lists.php.net to get a copy of this message
I wish to register some variables but get the following error. Warning: Supplied argument is not a valid MySQL result resource in /home/httpd/html/accounts/pos/include/login.php on line 17 Warning: Cannot add header information - headers already sent by (output started at /home/httpd/html/accounts/pos/include/login.php:17) in /home/httpd/html/accounts/pos/include/login.php on line 27 My code looks like this Kind regards Kevin <? session_start(); if ($UserName && $Password) { /* set our global variables */ global $UserName, $Password, $GST, $MarkUP; /* make connection to database */ MYSQL_PCONNECT("localhost", "$UserName", "$Password") OR DIE("Unable to connect to database"); /* select the database */ @mysql_select_db("pos") or die( "Unable to select database"); $queryVars = "SELECT * FROM Vars"; $resultVars ="MYSQL_QUERY($queryVars)"; while ($row = mysql_fetch_row($resultVars)) { $GST=$row[0]; $MarkUp=$row[1]; } session_register("UserName"); session_register("Password"); session_register("GST"); session_register("MarkUp"); } Header("Location: sales/sales.php"); ?>

« previous php.general (#4624) next »