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.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.