Results 1 to 4 of 4

Thread: Repeating Region Control

  1. #1
    Join Date
    Aug 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Repeating Region Control

    I'm looking to have some serious control over a Repeating Region. I've set up this code with DWCS3 on a 185px table nested in a 575px table. What I want to do is repeat the nested table 3 times horizontal, then move down to the next row and repeat another 3 times horizontal, and so on. As of now, it just puts each repeat vertically down the page, in a list-like way.

    Here's the code thus far. The record name is "Crutches". Any help would be greatly appreciated!
    Code:
    $maxRows_Crutches = 9;
    $pageNum_Crutches = 0;
    if (isset($_GET['pageNum_Crutches'])) {
      $pageNum_Crutches = $_GET['pageNum_Crutches'];
    }
    $startRow_Crutches = $pageNum_Crutches * $maxRows_Crutches;
    
    mysql_select_db($database_PRHconn, $PRHconn);
    $query_Crutches = "SELECT * FROM crutches ORDER BY crutchName ASC";
    $query_limit_Crutches = sprintf("%s LIMIT %d, %d", $query_Crutches, $startRow_Crutches, $maxRows_Crutches);
    $Crutches = mysql_query($query_limit_Crutches, $PRHconn) or die(mysql_error());
    $row_Crutches = mysql_fetch_assoc($Crutches);
    
    if (isset($_GET['totalRows_Crutches'])) {
      $totalRows_Crutches = $_GET['totalRows_Crutches'];
    } else {
      $all_Crutches = mysql_query($query_Crutches);
      $totalRows_Crutches = mysql_num_rows($all_Crutches);
    }
    $totalPages_Crutches = ceil($totalRows_Crutches/$maxRows_Crutches)-1;
    Last edited by RL Joneson; 08-19-2008 at 02:52 PM. Reason: Typo

  2. #2
    Join Date
    Aug 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Got it to work with a nice looper extension. case closed

  3. #3
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    557
    Thanks
    8
    Thanked 66 Times in 66 Posts

    Default

    use while(); to loop, and use a variable to declare the amount of rows you posted--once you have 3 rows horizontally, it'll skip to the next row; just a sec, i'm working on code for u.
    - Josh

  4. #4
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    557
    Thanks
    8
    Thanked 66 Times in 66 Posts

    Default

    PHP Code:
    $maxRows_Crutches 9;
    $pageNum_Crutches 0;
    if (isset(
    $_GET['pageNum_Crutches'])) {
      
    $pageNum_Crutches $_GET['pageNum_Crutches'];
    }
    $startRow_Crutches $pageNum_Crutches $maxRows_Crutches;

    mysql_select_db($database_PRHconn$PRHconn);
    $query_Crutches "SELECT * FROM crutches ORDER BY crutchName ASC";
    $query_limit_Crutches sprintf("%s LIMIT %d, %d"$query_Crutches$startRow_Crutches$maxRows_Crutches);
    $Crutches mysql_query($query_limit_Crutches$PRHconn) or die(mysql_error());
    $row_Crutches mysql_fetch_assoc($Crutches);

    if (isset(
    $_GET['totalRows_Crutches'])) {
      
    $totalRows_Crutches $_GET['totalRows_Crutches'];
    } else {
      
    $all_Crutches mysql_query($query_Crutches);
      
    $totalRows_Crutches mysql_num_rows($all_Crutches);
    }
    $totalPages_Crutches ceil($totalRows_Crutches/$maxRows_Crutches)-1;

    while(
    $c mysql_fetch_array$Crutches )) {

    $rowsNUM $rowsNUM 1// this is where we keep adding rows

    if($rowsNUM == 3) { // if there are already 3 horizontal thingys

    $rowsNUM 0// reset it to ZERO

    echo '
      </tr>
      <tr>
    '
    // start new row

    }

    echo 
    '
        <td>'
    .$c[data1].'</td>';  // please remember to edit this to display what you want! the identifier var is $c

    // stop whiling

    echo '</table>'
    record name is $Crutches, and your row data variable is $c. good luck ;-)
    Last edited by JShor; 08-21-2008 at 02:25 AM. Reason: messed up? oops.
    - Josh

Bookmarks

Posting Permissions

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