Jump to content

Displaying master details page results in columns!


wchamber22

Recommended Posts

Hi,

 

I am stuck. I have used dreamweaver to create a master details page with links to the details page successfully, but I would like to display the master details page results in 3 columns rather than the 1 column that dreamweaver defaults. As the site becomes richer the content will increase yielding many results, therfore the content displayed in a single column will require the users to scroll way down the page.

 

So, as it is now the results display as follows:

 

Plant1

Plant2

Plant3

Plant4

Plant5

Plant6

Plant7

Plant8

Plant9

etc...

 

I would like them to display as follows:

Plant1        Plant4        Plant7

Plant2        Plant5        Plant8

Plant3        Plant6        Plant9

 

Here is my code thus far:

<?php require_once('Connections/connGND.php'); ?>

<?php

if (!function_exists("GetSQLValueString")) {

function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

{

  if (PHP_VERSION < 6) {

    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  }

 

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

 

  switch ($theType) {

    case "text":

      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

      break;   

    case "long":

    case "int":

      $theValue = ($theValue != "") ? intval($theValue) : "NULL";

      break;

    case "double":

      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";

      break;

    case "date":

      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

      break;

    case "defined":

      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;

      break;

  }

  return $theValue;

}

}

 

mysql_select_db($database_connGND, $connGND);

$query_rsBotanicalA = "SELECT * FROM plants WHERE CatIDB = 'A'";

$rsBotanicalA = mysql_query($query_rsBotanicalA, $connGND) or die(mysql_error());

$row_rsBotanicalA = mysql_fetch_assoc($rsBotanicalA);

$totalRows_rsBotanicalA = mysql_num_rows($rsBotanicalA);

?>

<table border="0" align="left">

  <?php do { ?>

    <tr>

      <td align="left"><a href="plantdetails.php?recordID=<?php echo $row_rsBotanicalA['PlantID']; ?>"> <?php echo $row_rsBotanicalA['BotanicalName']; ?>  </a></td>

    </tr>

    <?php } while ($row_rsBotanicalA = mysql_fetch_assoc($rsBotanicalA)); ?>

</table>

 

Could someone help me to write this code, as I have been unsuccessful maintaining the links. I have been able get the results to display in the columsn as I would like, but I haven't been able to figure it out while maintaining the links!

 

Thanks.

 

 

Hi litebearer,

 

I have played around with the code via your link, and still haven't had success.  Some further assistance is needed.  I am a rookie and have no shame in copying and pasting code.

 

I just can't put everything together!  Sorry.

 

Bill C.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.