Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Feb 2010
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    problem Sorting a table by two criteria using CS4

    I am using CS4 to try to sort a DB which i am pulling onto a web page. I get the error message:
    "The Sort Table command cannot be applied to this table. Check that each TR tag contains only TD or TH tags. Also check that if the table contains THEAD, TFOOT and/or TBODY tags, there are no TR tags otuside of those sections."
    I don't think I have any THEAD, TFOOT or TBODY tages and it appears to me all TR tags only contain TD or TH tags.
    Please let me know what I am not seeing in this so i can use CS4 to make it sort. I am trying to sort by the "date" column first then the "time" column.
    Thanks ahead of time for your help.

    PHP Code:
    <?php require_once('../Connections/dodvitals.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function 
    GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
    {
      if (
    PHP_VERSION 6) {
        
    $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;
    }
    }

    mysql_select_db($database_dodvitals$dodvitals);
    $query_Recordset1 "SELECT * FROM tonyberish";
    $Recordset1 mysql_query($query_Recordset1$dodvitals) or die(mysql_error());
    $row_Recordset1 mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 mysql_num_rows($Recordset1);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>

    <body>
    <h1 align="center">Tony Berish - Vital Metrics</h1>
    <table border="1">
      <tr>
        <td>Entry Time</td>
        <td>Date</td>
        <td>Time</td>
        <td>HR</td>
        <td>BP</td>
        <td>SpO2</td>
        <td>Temp</td>
        <td>BloodGlucose</td>
        <td>Medication</td>
        <td>Dosage</td>
        <td>LOC</td>
      </tr>
      <?php do { ?>
        <tr>
          <td><?php echo $row_Recordset1['PrimaryKey']; ?></td>
          <td><?php echo $row_Recordset1['date']; ?></td>
          <td><?php echo $row_Recordset1['time']; ?></td>
          <td><?php echo $row_Recordset1['HR']; ?></td>
          <td><?php echo $row_Recordset1['BP']; ?></td>
          <td><?php echo $row_Recordset1['SpO2']; ?></td>
          <td><?php echo $row_Recordset1['Temp']; ?></td>
          <td><?php echo $row_Recordset1['BloodGlucose']; ?></td>
          <td><?php echo $row_Recordset1['Medication']; ?></td>
          <td><?php echo $row_Recordset1['Dosage']; ?></td>
          <td><?php echo $row_Recordset1['LOC']; ?></td>
        </tr>
        <?php } while ($row_Recordset1 mysql_fetch_assoc($Recordset1)); ?>
    </table>
    </body>
    </html>
    <?php
    mysql_free_result
    ($Recordset1);
    ?>

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Do you have any HTML in any of that data you are pulling into the table to display? That might be what's causing the complaint.

  • #3
    New to the CF scene
    Join Date
    Feb 2010
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts
    No HTML in the data. It is text, date, time and int only.

    MB


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •