Ask a Question related to Dreamweaver AppDev, Design and Development.
-
h1ppy #1
Only 1 record displaying?
Hi,
I have a problem with Dreamweaver MX2004. I create my page as defined by the
tutorial; connect to to my SQL database fine, displaying all the records in the
test box, no problem there.
I'm using PHP to call from the database and after creating the recordset page
and adding a repeat region I only seem to display 1 database entry? The
repeated region fails to display further records? Yet it is fine in test mode,
displaying all records.
This has been driving me mad for a few hours so I decided to come to the home
of Macromedia to see if any of you great people could assist?
I really appreciate any help provided.
Thanks in advance if you can assist.
Dave.
h1ppy Guest
-
Displaying the newest record first..
I know this is probably a brain dead question, but I can't remember how to display the latest database entry first, and the oldest entry last. Any... -
Displaying only a part of a record field
I would like to output only a part of a record field which is returned by a query. For example the outputed text would look like: "Drawing has... -
Displaying Date From a Database Record
Hi, Can anyone help??? I am trying to display the date that a record was posted to a database to an asp page but it appears in the wrong format... -
displaying a particular record in a particular location
Greetings, I am working with two recordsets and I wish to display the last record from one of those sets in a particular place on a page, and... -
Update Record only displaying first entry of database in the details page
Update Record only displaying first entry of database in the details page. It will update the record, it seems for some reason no matter what... -
David Powers #2
Re: Only 1 record displaying?
h1ppy wrote:
I don't know whether you have more than one recordset on your page, but> I'm using PHP to call from the database and after creating the recordset page
> and adding a repeat region I only seem to display 1 database entry? The
> repeated region fails to display further records? Yet it is fine in test mode,
> displaying all records.
if you do, make sure that you select the correct one in the drop-down
menu in the Repeat Region dialog box. Assuming you are displaying the
results in a table, make sure the entire table row is selected before
applying the server behavior.
--
David Powers
Author, "Foundation PHP 5 for Flash" (friends of ED)
Co-author "PHP Web Development with DW MX 2004" (Apress)
[url]http://computerbookshelf.com[/url]
David Powers Guest
-
h1ppy #3
Re: Only 1 record displaying?
Hi David,
Thanks for the prompt reply. I am only using a single recordset on the page
to try and figure this out. The correct recordset is selected in the drop down
menu. The bottom table row is fully selected and the repeat region has then
been applied.
You can see it here: [url]http://kxfinance.co.uk/new.php[/url]
As you can see it is only displaying a single record. There are 3 records in
the database that I am using to test. They all display fine here:
[url]http://www.kxfinance.co.uk/Event-Information-Database/Event_Information_view.php[/url]
Basically I want the database to pull all the records of the events and their
respective details. But it's failing every time for some reason.
Any help appreciated.
Thank you.
h1ppy Guest
-
h1ppy #4
Re: Only 1 record displaying?
<?php require_once('Connections/event.php'); ?>
<?php
$currentPage = $_SERVER["PHP_SELF"];
$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
mysql_select_db($database_event, $event);
$query_Recordset1 = "SELECT * FROM Event_Information";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1,
$startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $event) or
die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
$queryString_Recordset1 = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_Recordset1") == false &&
stristr($param, "totalRows_Recordset1") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s",
$totalRows_Recordset1, $queryString_Recordset1);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td><strong>Event Promoter </strong></td>
<td><strong>Event Name </strong></td>
<td><strong>Event Location </strong></td>
<td><strong>Event Date</strong></td>
<td><strong>Event Type </strong></td>
<td><strong>Ticker Cost </strong></td>
<td><strong>Event Attendance</strong></td>
<td><strong>Event Website</strong></td>
</tr>
<tr>
<td><?php echo $row_Recordset1['Event_Promoter']; ?></td>
<td><?php echo $row_Recordset1['Event_Name']; ?></td>
<td><?php echo $row_Recordset1['Event_Location']; ?></td>
<td><?php echo $row_Recordset1['Event_Date']; ?></td>
<td><?php echo $row_Recordset1['Event_Type']; ?></td>
<td><?php echo $row_Recordset1['Ticekt_Cost']; ?></td>
<td><?php echo $row_Recordset1['Event_Attendance']; ?></td>
<td><?php echo urldecode($row_Recordset1['Event_Website']); ?></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<?php do { ?>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
h1ppy Guest
-
David Powers #5
Re: Only 1 record displaying?
h1ppy wrote:
Right, I can see where you're making the mistake. You need to highlight
the row that contains your dynamic data from the Bindings panel. You
need to highlight this table row:
And then apply the server behavior. What you're doing is applying it to> <tr>
> <td><?php echo $row_Recordset1['Event_Promoter']; ?></td>
> <td><?php echo $row_Recordset1['Event_Name']; ?></td>
> <td><?php echo $row_Recordset1['Event_Location']; ?></td>
> <td><?php echo $row_Recordset1['Event_Date']; ?></td>
> <td><?php echo $row_Recordset1['Event_Type']; ?></td>
> <td><?php echo $row_Recordset1['Ticekt_Cost']; ?></td>
> <td><?php echo $row_Recordset1['Event_Attendance']; ?></td>
> <td><?php echo urldecode($row_Recordset1['Event_Website']); ?></td>
> </tr>
an empty row *below* the dynamic data:
As a result, only the first row of data displays, and you get two empty> <?php do { ?>
> <tr>
> <td> </td>
> <td> </td>
> <td> </td>
> <td> </td>
> <td> </td>
> <td> </td>
> <td> </td>
> <td> </td>
> </tr>
> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
rows.
In Code view, when you've applied it correctly, your table should look
like this:
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td><strong>Event Promoter </strong></td>
<td><strong>Event Name </strong></td>
<td><strong>Event Location </strong></td>
<td><strong>Event Date</strong></td>
<td><strong>Event Type </strong></td>
<td><strong>Ticker Cost </strong></td>
<td><strong>Event Attendance</strong></td>
<td><strong>Event Website</strong></td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_Recordset1['Event_Promoter']; ?></td>
<td><?php echo $row_Recordset1['Event_Name']; ?></td>
<td><?php echo $row_Recordset1['Event_Location']; ?></td>
<td><?php echo $row_Recordset1['Event_Date']; ?></td>
<td><?php echo $row_Recordset1['Event_Type']; ?></td>
<td><?php echo $row_Recordset1['Ticekt_Cost']; ?></td>
<td><?php echo $row_Recordset1['Event_Attendance']; ?></td>
<td><?php echo urldecode($row_Recordset1['Event_Website']); ?></td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
--
David Powers
Author, "Foundation PHP 5 for Flash" (friends of ED)
Co-author "PHP Web Development with DW MX 2004" (Apress)
[url]http://computerbookshelf.com[/url]
David Powers Guest
-
h1ppy #6
Re: Only 1 record displaying?
Thanks David!
I found another way around the problem as well. The tutorial skips a whole
process whereby you have to drag a repeat of the original binding in to the
repeat region area, for each field to be represented in the database. Unless
you follow your instructions above.
Silly but it's not covered in the tutorial.
Stumped me for a while!
Thanks to David.
I owe you a beer. :)
h1ppy Guest
-
David Powers #7
Re: Only 1 record displaying?
h1ppy wrote:
Yes, it is silly. I've never done the tutorial, so I'm not familiar with> Silly but it's not covered in the tutorial.
its contents.
I'll drink to that. Cheers.> I owe you a beer. :)
--
David Powers
Author, "Foundation PHP 5 for Flash" (friends of ED)
Co-author "PHP Web Development with DW MX 2004" (Apress)
[url]http://computerbookshelf.com[/url]
David Powers Guest
-



Reply With Quote

