0 Replies Latest reply on Apr 10, 2011 6:00 AM by Sharon Nesha

    Why is my detail page blank with no data from master page?

    Sharon Nesha

      Hello,

      I created master page that links to detail page - but when I click on the link I see the detail page empty from data.

      Do you know why? Thanks!

       

      This is the PHP code I'm using in the detail page:

       

       

       

      <?php require_once('../Connections/connection1.php'); ?>
      <?php
      function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      {
        $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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;
      }

      $editFormAction = $_SERVER['PHP_SELF'];
      if (isset($_SERVER['QUERY_STRING'])) {
        $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
      }

      if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "formUpdateSale")) {
        $updateSQL = sprintf("UPDATE neve_sale SET type=%s, area=%s, address=%s, built=%s, lot=%s, BR=%s, floor=%s, floorAll=%s, parking=%s, elevator=%s, price=%s, available=%s, `date`=%s, status=%s, details=%s, myDetails=%s, pic1=%s, pic2=%s, pic3=%s, pic4=%s, pic5=%s WHERE `primary`=%s",
                             GetSQLValueString($_POST['type'], "text"),
                             GetSQLValueString($_POST['area'], "text"),
                             GetSQLValueString($_POST['address'], "text"),
                             GetSQLValueString($_POST['built'], "int"),
                             GetSQLValueString($_POST['lot'], "int"),
                             GetSQLValueString($_POST['BR'], "int"),
                             GetSQLValueString($_POST['floor'], "int"),
                             GetSQLValueString($_POST['floorAll'], "int"),
                             GetSQLValueString($_POST['parking'], "text"),
                             GetSQLValueString($_POST['elevator'], "text"),
                             GetSQLValueString($_POST['price'], "int"),
                             GetSQLValueString($_POST['available'], "text"),
                             GetSQLValueString($_POST['date'], "date"),
                             GetSQLValueString($_POST['status'], "text"),
                             GetSQLValueString($_POST['details'], "text"),
                             GetSQLValueString($_POST['myDetails'], "text"),
                             GetSQLValueString($_POST['pic1'], "text"),
                             GetSQLValueString($_POST['pic2'], "text"),
                             GetSQLValueString($_POST['pic3'], "text"),
                             GetSQLValueString($_POST['pic4'], "text"),
                             GetSQLValueString($_POST['pic5'], "text"),
                             GetSQLValueString($_POST['primary'], "int"));

        mysql_select_db($database_connection1, $connection1);
        $Result1 = mysql_query($updateSQL, $connection1) or die(mysql_error());

        $updateGoTo = "admin-sales1.php";
        if (isset($_SERVER['QUERY_STRING'])) {
          $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
          $updateGoTo .= $_SERVER['QUERY_STRING'];
        }
        header(sprintf("Location: %s", $updateGoTo));
      }

      $colname_Recordset1 = "-1";
      if (isset($_GET['primary'])) {
        $colname_Recordset1 = (get_magic_quotes_gpc()) ? $_GET['primary'] : addslashes($_GET['primary']);
      }
      mysql_select_db($database_connection1, $connection1);
      $query_Recordset1 = sprintf("SELECT * FROM neve_sale WHERE `primary` = %s", $colname_Recordset1);
      $Recordset1 = mysql_query($query_Recordset1, $connection1) or die(mysql_error());
      $row_Recordset1 = mysql_fetch_assoc($Recordset1);
      $totalRows_Recordset1 = mysql_num_rows($Recordset1);
      ?>