473,247 Members | 2,869 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,247 software developers and data experts.

3 Column repeat region? {DW}

[FYI:I'm using Dreamweaver 2004 for my interface. ]
I don't have a problem laying out a recordset in php/mysql, but each record
is returned in a single row in a table file.
Is there a way to return say 3 images and descriptions in a 3 column list
instead? I mean I'd like the repeating region to be horizontal for three
records, e.g., rather than merely one repeating row for each item.

Thanks
Jeff


~~~~~~~~~~~~
Jefferis Peterson, Pres.
Web Design and Marketing
http://www.PetersonSales.com

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Jul 17 '05 #1
7 3368
I noticed that Message-ID: <BE***********************@hotmail.com> from
Jefferis NoSpamme contained the following:
I don't have a problem laying out a recordset in php/mysql, but each record
is returned in a single row in a table file.
Is there a way to return say 3 images and descriptions in a 3 column list
instead? I mean I'd like the repeating region to be horizontal for three
records, e.g., rather than merely one repeating row for each item.


Not sure how DW would tackle this but let's consider the code. For
three columns you need:

<tr><td>description</td><td>image</td>

then

<td>description</td><td>image</td>

then

<td>description</td><td>image</td></tr>

Notice the differences?

The bit in the middle stays the same, only the ends change.
Suppose we define two arrays
$s=array("<tr>","","");
$e=array("","","</tr>"

Then something like

$s[0]<td>description</td><td>image</td>$e[0]

$s[1]<td>description</td><td>image</td>$e[1]

$s[2]<td>description</td><td>image</td></tr>$e[2]

Should do what we want.

Finally you just need a method of generating those array indices.
Start by initialising a counter
$i=0;

Clearly, for the first row you have
$s[$i]<td>description</td><td>image</td>$e[$i]

But $i needs to increment before we get the next row (but go back to
zero every third row)

So..

$i++;
if($i>2){$i=0;}
All you have to do is put it together...

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #2
Hi Geoff,
Maybe this will work, but the trouble I'm having is more in line with how
the MySQL queries are displayed as a result of repeated regions. The code
below may clarify the problem:
On 2/4/05 3:11 PM, in article k5********************************@4ax.com,
"Geoff Berrow" <bl******@ckdog.co.uk> wrote:
$s[0]<td>description</td><td>image</td>$e[0]

$s[1]<td>description</td><td>image</td>$e[1]

$s[2]<td>description</td><td>image</td></tr>$e[2]

Should do what we want.

So..

$i++;
if($i>2){$i=0;}


Let me give you some of the code and the query at the bottom.
The display table:
<table width="550" border="2" align="center" cellpadding="0" cellspacing="1"
bordercolor="#333333">
<tr>
<td width="50%">
<div align="center">
<p><?php echo $row_viewall['descrip']; ?> </p>
....
<?php echo $row_viewall['item_name']; ?>" border="0"></a><br>
<?php echo $row_viewall['designer']; ?>
<br>
<?php echo $row_viewall['item']; ?></div></td>
</tr>
</table>
<?php } while ($row_viewall = mysql_fetch_assoc($viewall)); ?>
The query is set up to display info linked to the database row.

The Query:

~~~~~~~~~~~~~~

$maxRows_viewall = 5;
$pageNum_viewall = 0;
if (isset($_GET['pageNum_viewall'])) {
$pageNum_viewall = $_GET['pageNum_viewall'];
}
$startRow_viewall = $pageNum_viewall * $maxRows_viewall;

mysql_select_db($database_jodenonline, $jodenonline);
$query_viewall = "SELECT * FROM `Catalog` WHERE `Catalog`.img_status = '1'
AND `Catalog`.designer Like '%Victorian%' ORDER BY `Catalog`.sold ASC";
$query_limit_viewall = sprintf("%s LIMIT %d, %d", $query_viewall,
$startRow_viewall, $maxRows_viewall);
$viewall = mysql_query($query_limit_viewall, $jodenonline) or
die(mysql_error());
$row_viewall = mysql_fetch_assoc($viewall);

if (isset($_GET['totalRows_viewall'])) {
$totalRows_viewall = $_GET['totalRows_viewall'];
} else {
$all_viewall = mysql_query($query_viewall);
$totalRows_viewall = mysql_num_rows($all_viewall);
}
$totalPages_viewall = ceil($totalRows_viewall/$maxRows_viewall)-1;

$queryString_viewall = "";
if (!empty($HTTP_SERVER_VARS['QUERY_STRING'])) {
$params = explode("&", $HTTP_SERVER_VARS['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_viewall") == false &&
stristr($param, "totalRows_viewall") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_viewall = "&" . implode("&", $newParams);
}
}
$queryString_viewall = sprintf("&totalRows_viewall=%d%s",
$totalRows_viewall, $queryString_viewall);
?>

~~~~~~~~~~~~
Jefferis Peterson, Pres.
Web Design and Marketing
http://www.PetersonSales.com

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Jul 17 '05 #3
I noticed that Message-ID: <BE***********************@hotmail.com> from
Jefferis NoSpamme contained the following:
Maybe this will work, but the trouble I'm having is more in line with how
the MySQL queries are displayed as a result of repeated regions. The code
below may clarify the problem:


You need to understand how this works. The query returns rows and the
while loop iterates through the rows. While you are simply displaying
rows as table rows the code can be the same each time. To save it in
groups of three means that the region needs to change each row of the
iteration.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #4
Is is possible to change each region without calling in an overlapping
display of the items? Everything seems to be structured by the WHILE to call
each record sequentially. While it might be possible to call items by row
and column, the WHILE statement would create columns infinitely to the end
of the query unless bounded.
Dreamwweaver is no help in structuring this query and display because it
defaults to sequential rows. Since the database itself is structured by row
per item, a column data call might get really hairy.
I just can't think of how this layout might be done.

Thanks
Jeff
On 2/4/05 6:20 PM, in article 66********************************@4ax.com,
"Geoff Berrow" <bl******@ckdog.co.uk> wrote:
You need to understand how this works. The query returns rows and the
while loop iterates through the rows. While you are simply displaying
rows as table rows the code can be the same each time. To save it in
groups of three means that the region needs to change each row of the
iteration.


~~~~~~~~~~~~
Jefferis Peterson, Pres.
Web Design and Marketing
http://www.PetersonSales.com

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Jul 17 '05 #5
Hey Geoff,
I think this $e array would not work properly. You have the $e at the end of
each $s, but that would create a new row after each image/description pair.
The <tr> has to be outside each set of 3 returned items.

For simplicity's sake, let's just use 1 item in a cell, called item
name.The record set query is calling 100 items, say.

<tr>
<?php do { ?>

<td >
<?php echo $row_RecordSet1['item_name']; ?>
</td>

<?php } while ($row_RecordSet1 = mysql_fetch_assoc($RecordSet1)); ?>
</tr>

And I have maximum records per page:
$maxRows_RecordSet1 = 9;
I keep trying to create a for while loop, but I'm getting stumped.

Jeff

On 2/4/05 3:11 PM, in article k5********************************@4ax.com,
"Geoff Berrow" <bl******@ckdog.co.uk> wrote:

Notice the differences?

The bit in the middle stays the same, only the ends change.
Suppose we define two arrays
$s=array("<tr>","","");
$e=array("","","</tr>"

Then something like

$s[0]<td>description</td><td>image</td>$e[0]

$s[1]<td>description</td><td>image</td>$e[1]

$s[2]<td>description</td><td>image</td></tr>$e[2]

Should do what we want.

Finally you just need a method of generating those array indices.
Start by initialising a counter
$i=0;

Clearly, for the first row you have
$s[$i]<td>description</td><td>image</td>$e[$i]

But $i needs to increment before we get the next row (but go back to
zero every third row)

So..

$i++;
if($i>2){$i=0;}

~~~~~~~~~~~~
Jefferis Peterson, Pres.
Web Design and Marketing
http://www.PetersonSales.com

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Jul 17 '05 #6
I noticed that Message-ID: <BE***********************@hotmail.com> from
Jefferis NoSpamme contained the following:
I think this $e array would not work properly. You have the $e at the end of
each $s, but that would create a new row after each image/description pair.


No it wouldn't because it's an array
$s=array("<tr>","","");
$e=array("","","</tr>"

$e[0] is empty.
$e[1] is empty
only$e[2] contains the </tr>

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #7
Doh!

:-)

On 2/7/05 3:55 PM, in article 6j********************************@4ax.com,
"Geoff Berrow" <bl******@ckdog.co.uk> wrote:
No it wouldn't because it's an array
$s=array("<tr>","","");
$e=array("","","</tr>"

$e[0] is empty.
$e[1] is empty
only$e[2] contains the </tr>


~~~~~~~~~~~~
Jefferis Peterson, Pres.
Web Design and Marketing
http://www.PetersonSales.com

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Jul 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: duncan.lovett | last post by:
PHP 4 MySQL 4.0.20 DW MW 2004 7.01 This problem is giving me a bit of a headache, and I'm getting nowhere with it so thought I'd open it up to all, any help would be greatly appreciated. ...
1
by: RJ | last post by:
Hello! I am trying to lay out a left navigation column with a background image, where the left nav column runs the entire scrolled height/length of the page. The float:left column layout works...
19
by: Owen T. Soroke | last post by:
Using VB.NET I have a ListView with several columns. Two columns contain integer values, while the remaining contain string values. I am confused as to how I would provide functionality to...
0
by: Simon Gare | last post by:
Hi, I need to calculate a total based on fields in a repeat region, these values are stored in an SQL db, all are numeric and written in ASP. fields are TOTAL_COST VAT ...
31
by: Sarita | last post by:
Hello, this might sound stupid, but I got a really nice homepage template which unfortunately is a 3-Column Fixed Width CSS format. Now I don't have any content for the right column and would...
1
by: nicky77 | last post by:
hi there, i'm pretty inexperienced with CSS, so apologies for the shoddy coding. i'm trying to set a 3 column layout using different background images for each column. however, i have whitespace at...
6
by: Christopera | last post by:
I built a this sites http://www.ourzeal.com/walko/index.html . If you look closely at the far right column it is about 1 px higher than the other two. The source does validate. I can not however...
1
by: Tjwapa | last post by:
How do i convert a column with id letters in a file to a number 1 or 0 in coldfusion output....for example 'CON' or 'BUS' to be converted to an output of '0'and '1' (0 to represent CON and 1 for...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.