Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Adding session variable causes Dreamweaver to not recognize recordset

Guest
Nov 19, 2009 Nov 19, 2009

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!

TOPICS
Server side applications

Views

250
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 19, 2009 Nov 19, 2009

Copy link to clipboard

Copied

LATEST

Found the answer, changing from  <?php echo $_SESSION['username']; ?>  to   $_SESSION['username'];  resolved the issue.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines