2 Replies Latest reply on May 27, 2009 12:01 PM by justdunno

    Recordset will not show up in my browser  (dreamweaver's msg: node=null)

    justdunno

      Hi,

       

      I'm trying to create recordsets for my tables and everything was working fine, but this afternoon, every time I created a recordset it kept giving me this error "node=nul"  ... that's all it said. I disregarded this and went about my business, dragging rows from the recordset

      in to my tables. Everything looks fine in Design View, but no dynamic data appears in my browser.

      I know it has something to do with node=null, but I really don't get what it wants from me.

      Can someone please help?

      Here is my code:

       

       

      <?php require_once('Connections/conn.php'); ?>
      <?php
      if (!function_exists("GetSQLValueString")) {
      function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

       

        $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

       

        switch ($theType) {
          case "text":
            $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
            break;   
          case "long":
          case "int":
            $theValue = ($theValue != "") ? intval($theValue) : "NULL";
            break;
          case "double":
            $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
            break;
          case "date":
            $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
            break;
          case "defined":
            $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
            break;
        }
        return $theValue;
      }
      }

       

      $maxRows_rsVisits = 10;
      $pageNum_rsVisits = 0;
      if (isset($_GET['pageNum_rsVisits'])) {
        $pageNum_rsVisits = $_GET['pageNum_rsVisits'];
      }
      $startRow_rsVisits = $pageNum_rsVisits * $maxRows_rsVisits;

       

      $colname_rsVisits = "-1";
      if (isset($_GET['Patient_id'])) {
        $colname_rsVisits = $_GET['Patient_id'];
      }
      mysql_select_db($database_conn, $conn);
      $query_rsVisits = sprintf("SELECT * FROM visit WHERE Patient_id = %s", GetSQLValueString($colname_rsVisits, "int"));
      $query_limit_rsVisits = sprintf("%s LIMIT %d, %d", $query_rsVisits, $startRow_rsVisits, $maxRows_rsVisits);
      $rsVisits = mysql_query($query_limit_rsVisits, $conn) or die(mysql_error());
      $row_rsVisits = mysql_fetch_assoc($rsVisits);

       

      if (isset($_GET['totalRows_rsVisits'])) {
        $totalRows_rsVisits = $_GET['totalRows_rsVisits'];
      } else {
        $all_rsVisits = mysql_query($query_rsVisits);
        $totalRows_rsVisits = mysql_num_rows($all_rsVisits);
      }
      $totalPages_rsVisits = ceil($totalRows_rsVisits/$maxRows_rsVisits)-1;
      ?>
      <?php

       

      <table border="1" cellpadding="5" cellspacing="3">
        <tr>
          <td>Patient_id</td>
          <td>Doctor_id</td>
          <td>VisitDate</td>
          <td>Reason</td>
          <td>DocNotes</td>
        </tr>
        <?php do { ?>
          <tr>
            <td><?php echo $row_rsVisits['Patient_id']; ?></td>
            <td><?php echo $row_rsVisits['Doctor_id']; ?></td>
            <td><?php echo $row_rsVisits['VisitDate']; ?></td>
            <td><?php echo $row_rsVisits['Reason']; ?></td>
            <td><?php echo $row_rsVisits['DocNotes']; ?></td>
          </tr>
          <?php } while ($row_rsVisits = mysql_fetch_assoc($rsVisits)); ?>
      </table>

       

       

      Thank you in advance