View Full Version : Spry or PHP help please

03-11-2009, 11:04 AM
Hi all,

I need a bit of guidance with DW CS3, I have had a look at the spry widgets to produce a list of events, which when clicked gives more detail in the detail region. I must say I found this quite flaky to work with at best.

So my question is, now I have created a MYSQL table with the data how do I get a similar type of functionality or am I stuck using spry?



03-12-2009, 12:35 AM
yes you could using php/mysql is the simple answerhows your php knowledge?

03-12-2009, 11:55 AM
Thanks for your time; I managed to get it to work, using just PHP.

I added a repeating list than recalled the page via a link to update table containing the detail fields. I will post the code if anyone is interested.

Once again thanks.

03-12-2009, 01:40 PM
post it

get it out for the members!

03-12-2009, 06:36 PM
Here is the code, only two things left to do.

Always load the first record into the detail panel
look at how to reposition the page if it scrolls when an item is selected.Paul.

// Database connect
mysql_select_db($database_DB_Conn, $DB_Conn);
// Create the query
$query_RS_Placement = "SELECT * FROM placement ORDER BY type ASC";
// Runn the query
$RS_Placement = mysql_query($query_RS_Placement, $DB_Conn) or die(mysql_error());
// Look this up I think the current row
$row_RS_Placement = mysql_fetch_assoc($RS_Placement);
// is this the number of rows
$totalRows_RS_Placement = mysql_num_rows($RS_Placement);
$colname_DetailRS1 = "-1";
// Was a record id passed in the URL?
if (isset($_GET['recordID'])) {
$colname_DetailRS1 = $_GET['recordID'];
else {
// If not show the default record, will change this to show first record...
$colname_DetailRS1 =4; // This is the default entry
// Build the query
$query_DetailRS1 = sprintf("SELECT * FROM placement WHERE id = %s ORDER BY type ASC", GetSQLValueString($colname_DetailRS1, "text"));
// Run the query
$DetailRS1 = mysql_query($query_DetailRS1, $DB_Conn) or die(mysql_error());
// Get the first record
$row_DetailRS1 = mysql_fetch_assoc($DetailRS1);
// Get the number of records
$totalRows_DetailRS1 = mysql_num_rows($DetailRS1);
<table width="69%" id="Place_Detail" class="floatright">
<th width="30%">Employer / Provider:</th>
<td width = "*"><?php echo $row_DetailRS1['employer']; ?></td>
<td><?php echo $row_DetailRS1['description']; ?> </td>
<th>Contact name:</th>
<td><?php echo $row_DetailRS1['contactname']; ?> </td>
<th>Contact phone:</th>
<td><?php echo $row_DetailRS1['contactphone']; ?> </td>
<th>Contact e-mail:</th>
<td><?php echo $row_DetailRS1['contactemail']; ?> </td>

<!-- List of Placement table format is Folat Left -->

<table width="28%" id="Place_List">
<th width="30%">Placement<br/>Type</th>
do { ?>
<td><a href="../vacancies/idx_Vac.php?recordID=<?php echo $row_RS_Placement['id']#list; ?>" name="list"> <?php echo $row_RS_Placement['type']; ?> </a></td>
<td><a href="../vacancies/idx_Vac.php?recordID=<?php echo $row_RS_Placement['id']#list; ?>"> <?php echo $row_RS_Placement['employer']; ?> </a></td>
<?php } while ($row_RS_Placement = mysql_fetch_assoc($RS_Placement)); ?>
<p class="SiteNewsText">
<?php echo $totalRows_RS_Placement ?> Records Total

03-12-2009, 09:20 PM

wana learn how to code PHP rather than letting Dreamweaver do it for you

03-17-2009, 10:21 AM

You should take David's advice and learn to code.

It is not that hard to get to grips with, I took David's advice a while ago now and havnt looked back. You will find things so much easier once you take the plunge. You code will become clearer, easier to understand and take up less space.

David's tutorials, teaching and guidance is second to none. You should go for it.

Regards, Paul