Copy link to clipboard
Copied
I have a recordset that I have written in advanced mode, the test checks out fine and dreamweaver reconizes it in "server behaviors" and the code is colorized in "code view". Testing the page in a browser works fine.
Adding a variable for session username, still checks out with MySQL and saves to the page but is no longer recognized in the "server behaviors" and in "code view" it is no longer colorized. All server behaviors that use a recodset as in repeat regions break and cannot find the recordset. Testing in a browser quickly displays a blank page in firefox and a 500 error in IE.
This is with a bogus variable, which loads fine.
mysql_select_db($database_ess, $ess);
$query_client_bdays = "SELECT clients.clientname, clients.birthmonth, clients.birthday FROM clients WHERE clients.username=username AND CONCAT(YEAR(CURDATE()),'-',birthmonth,'-',birthday) BETWEEN DATE_ADD(CURDATE(), interval 30 day) AND DATE_ADD(CURDATE(), interval 60 day)";
$client_bdays = mysql_query($query_client_bdays, $ess) or die(mysql_error());
$row_client_bdays = mysql_fetch_assoc($client_bdays);
$totalRows_client_bdays = mysql_num_rows($client_bdays);
Here is with the session
$varU_client_bdays = "-1";
if (isset(<?php echo $_SESSION['username']; ?>
)) {
$varU_client_bdays =<?php echo $_SESSION['username']; ?>;
}
mysql_select_db($database_ess, $ess);
$query_client_bdays = sprintf("SELECT clientname, birthmonth, birthday FROM clients WHERE clients.username=%s AND CONCAT(YEAR(CURDATE()),'-',birthmonth,'-',birthday) BETWEEN DATE_ADD(CURDATE(), interval 30 day) AND DATE_ADD(CURDATE(), interval 60 day)", GetSQLValueString($varU_client_bdays, "text"));
$client_bdays = mysql_query($query_client_bdays, $ess) or die(mysql_error());
$row_client_bdays = mysql_fetch_assoc($client_bdays);
$totalRows_client_bdays = mysql_num_rows($client_bdays);
I have also included a screen shot of the mess in code view.
Thanks for any help in advance!
Copy link to clipboard
Copied
Found the answer, changing from <?php echo $_SESSION['username']; ?> to $_SESSION['username']; resolved the issue.