close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Horizontal recordset repeat

Thread began 1/10/2017 9:18 am by Darren | Last modified 1/23/2017 3:21 pm by Ray Borduin | 523 views | 7 replies |

Darren

Horizontal recordset repeat

I'm trying to output a recordset horizontal instead of vertical

I have a SQL/recordset with 6 ids each with 5 fields

example of recordset id1
RS1
id = RS1
field1 = txt11
field2 = txt12
field3 = txt13
field4 = txt14
field5 = txt15


with datassist I can output the recordset

RS1 - txt11 - txt12 - txt13 - txt14 - txt15
RS2 - txt21 - txt22 - txt23 - txt24 - txt25
RS3 - txt31 - txt32 - txt33 - txt34 - txt35
RS4 - txt41 - txt42 - txt43 - txt44 - txt45
RS5 - txt51 - txt52 - txt53 - txt54 - txt55
RS6 - txt61 - txt62 - txt63 - txt64 - txt65



I am trying to rotate this so the id is at the top and the field follow down

RS1 RS2 RS3 RS4 RS5 RS6
txt11 txt21 txt31 txt41 txt51 txt61
txt12 txt22 txt32 txt42 txt52 txt62
txt13 txt22 txt33 txt43 txt53 txt63
txt14 txt22 txt34 txt44 txt54 txt64
txt15 txt22 txt35 txt45 txt55 txt65


as suggestion how I do this with datassist

Sign in to reply to this post

Ray BorduinWebAssist

I think you can do this by putting the values into a <div style="width:16%; float:left"> and just separate the values with <br/>.

Then the six columns should display the way you want.

Sign in to reply to this post

Darren

thanks for the reply

not sure I understand your response. here is example of the code I have that

RS1 - txt11 - txt12 - txt13 - txt14 - txt15
RS2 - txt21 - txt22 - txt23 - txt24 - txt25
RS3 - txt31 - txt32 - txt33 - txt34 - txt35
RS4 - txt41 - txt42 - txt43 - txt44 - txt45
RS5 - txt51 - txt52 - txt53 - txt54 - txt55
RS6 - txt61 - txt62 - txt63 - txt64 - txt65



<table>
<tr>
<th>Service Table</th>
</tr>
<tr>
<th>&nbsp;</th>
<th>serv_title 1</th>
<th>serv_title 2</th>
<th>serv_title 3</th>
<th>serv_title 4</th>
<th>serv_title 5</th>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_RS1['serv'];?></td>
<td><?php echo $row_RS1['serv1'];?></td>
<td><?php echo $row_RS1['serv2'];?></td>
<td><?php echo $row_RS1['serv3'];?></td>
<td><?php echo $row_RS1['serv4'];?></td>
<td><?php echo $row_RS1['serv5'];?></td>
</tr>
<?php } while ($row_RS1 = mysql_fetch_assoc($RS1)); ?>
</table>




here is example of what I am looking to do but this won't work as you can only read the table once (it seems)

RS1 RS2 RS3 RS4 RS5 RS6
txt11 txt21 txt31 txt41 txt51 txt61
txt12 txt22 txt32 txt42 txt52 txt62
txt13 txt22 txt33 txt43 txt53 txt63
txt14 txt22 txt34 txt44 txt54 txt64
txt15 txt22 txt35 txt45 txt55 txt65




<table>
<tr>
<th>Service Table</th>
</tr>
<tr>
<th>&nbsp;</th>
<?php do { ?>
<th><?php echo $row_RS1['serv'];?></th>
<?php } while ($row_RS1 = mysql_fetch_assoc($RS1)); ?>
</tr>
<tr>
<th>serv title1</th>
<?php do { ?>
<th><?php echo $row_RS1['serv1'];?></th>
<?php } while ($row_RS1 = mysql_fetch_assoc($RS1)); ?>
</tr>
<tr>
<th>serv title2</th>
<?php do { ?>
<th><?php echo $row_RS1['serv2'];?></th>
<?php } while ($row_RS1 = mysql_fetch_assoc($RS1)); ?>
</tr>
<tr>
<th>serv title3</th>
<?php do { ?>
<th><?php echo $row_RS1['serv3'];?></th>
<?php } while ($row_RS1 = mysql_fetch_assoc($RS1)); ?>
</tr>
<tr>
<th>serv title4</th>
<?php do { ?>
<th><?php echo $row_RS1['serv4'];?></th>
<?php } while ($row_RS1 = mysql_fetch_assoc($RS1)); ?>
</tr>
<tr>
<th>serv title5</th>
<?php do { ?>
<th><?php echo $row_RS1['serv5'];?></th>
<?php } while ($row_RS1 = mysql_fetch_assoc($RS1)); ?>
</tr>
</table>

Sign in to reply to this post

Ray BorduinWebAssist

You can return to the first row in a recordset with:

<?php
mysql_data_seek($RS1,0);
$row_RS1 = mysql_fetch_assoc($RS1);
?>

The code I was referring to would look like:


<div id="results_wrapper">
<?php do { ?>
<div style="float:left; width:16%;">
<?php echo $row_RS1['serv'];?><br/>
<?php echo $row_RS1['serv1'];?><br/>
<?php echo $row_RS1['serv2'];?><br/>
<?php echo $row_RS1['serv3'];?><br/>
<?php echo $row_RS1['serv4'];?><br/>
<?php echo $row_RS1['serv5'];?><br/>
</div>
<?php } while ($row_RS1 = mysql_fetch_assoc($RS1)); ?>
</div>

Sign in to reply to this post

Darren

thanks again, this works great with the small test table, but my prod table has 10 records and each has 30+ fields of which not all have information, therefore its a little hard to read and trying to align each field and the headers in the first column (which is plain text)

The table is a service table, the top headers (from recordset) show service and the left column heads (plain text) show what items are included in the service options, the recordset is then spanned across the options. (hope this makes sense)

is their anyway to get your code into a table or create a box around the DIVs ? I have tried CSS but some reason its not drawing the lines

I was trying to see if dataassist repeat could do this - thanks again

Sign in to reply to this post

Ray BorduinWebAssist

You can box the divs by nesting another div like:

php:
<style>

.resultCol {
  float:left; 
  width:16%;
}
.resultCell {
  box-style: border-box;
  border: 1px solid black;
  height: 22px;
}
</style>
<div id="results_wrapper">
<?php do { ?>
<div class="resultCol">
<div class="resultCell"><?php echo $row_RS1['serv'];?></div>
<div class="resultCell"><?php echo $row_RS1['serv1'];?></div>
<div class="resultCell"><?php echo $row_RS1['serv2'];?></div>
<div class="resultCell"><?php echo $row_RS1['serv'3];?></div>
<div class="resultCell"><?php echo $row_RS1['serv4'];?></div>
<div class="resultCell"><?php echo $row_RS1['serv5'];?></div>
</div>
<?php } while ($row_RS1 mysql_fetch_assoc($RS1)); ?>
</div>
Sign in to reply to this post

Darren

thank you Ray, this worked great - had a little issue getting the vertical alignment but finally got that working


WebAssist - will DataAssist3 provide this function and will I be able to just update my version ? or will I have to update my older version of the supersuite ?

Sign in to reply to this post

Ray BorduinWebAssist

DataAssist won't write the html for you for something like this. It will still depend on you creating the html structure you want and then creating recordsets and applying repeated regions for this type of effect.

There will be upgrade pricing for previous owners when the new version comes out.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...