Ask a Question related to Dreamweaver AppDev, Design and Development.
-
jface #1
Re: PHP session variables and MySQL
I answered this from the news reader many hours ago, but it seems to have been
swallowed up by the system. Your problem lies with the quotes in
$_SESSION['validuser']. What's happening is that the first single quote inside
the square brackets is matching the single quote just before $_SESSION, turning
the rest of the string into unidentified data. There are several ways around
this. The first is to remove the quotes inside the square brackets:
$query_memberviewquery = 'SELECT * FROM artistmembers WHERE email
='$_SESSION[validuser]' ORDER BY membername ASC'; This is acceptable, but may
cause a warning notice (depending on the level of error reporting). The better
way is as follows: $query_memberviewquery = 'SELECT * FROM artistmembers WHERE
email =''.$_SESSION['validuser'].'' ORDER BY membername ASC'; What this does
is to build the query from three elements: the first part of the query as a
string, followed by the session variable, and finally, the last part, again as
a the string. -- David Powers Author, 'Foundation PHP 5 for Flash' (friends
of ED) Co-author 'PHP Web Development with DW MX 2004' (Apress)
[url]http://computerbookshelf.com[/url]
jface Guest
-
#39833 [NEW]: Session variables overwritten by local variables (register_globals=off)
From: sup1382 at accedo dot es Operating system: OpenBSD 3.9 PHP version: 5.2.0 PHP Bug Type: Session related Bug... -
#39447 [NEW]: Want to optionally handle apc_upload_progress variables using session variables
From: krudtaa at yahoo dot com Operating system: All PHP version: 5.2.0 PHP Bug Type: Feature/Change Request Bug... -
MySQL/PHP problem. getting field names from MySQL and using it asPHP variables
Is this possible? I'd like to just get the field names from my database and use it as variables to save me from making errors as to where i should... -
MySQL and PHP Session Variables
The following 3 mysql/php statements are used in my home page to access my admin table: $php_linkID = mysql_pconnect("localhost","user","pw");... -
Session problem when setting session variables in files that are in different directories
I am running PHP 4.3.0 on a WinXPpro machine and I recently got problem with sessions. What I am building is a loginsystem and I need to save... -



Reply With Quote

