Adobe Spry: How to separate one column into two

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
MartinMar52011
Forum Newbie
Posts: 2
Joined: Sat Mar 05, 2011 6:25 pm

Adobe Spry: How to separate one column into two

Post by MartinMar52011 »

I have the complete code below (minus the two style sheet files). Right now the webpage will display two columns of names (lets consider one last names at the moment). The script will result in the display of two columns with the same list of names.
The problem is: I want only half the names to appear in one column (lets say from Albert to Henry) and the other half in the other column (lets say from Homer to Zebra). Does someone know how to amend this code so that it will display the names as desired?

CODE BELOW:

<?php require_once('Connections/connector.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_connector, $connector);
$query_Recordset1 = "SELECT name FROM listings_name ORDER BY name_id ASC";
$Recordset1 = mysql_query($query_Recordset1, $connector) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Name Search</title>
<style type="text/css">
</style>
<link href="common_styles.css" rel="stylesheet" type="text/css" />
<link href="main_cols.css" rel="stylesheet" type="text/css" />
<script src="SpryAssets/SpryData.js" type="text/javascript"></script>
<script src="SpryAssets/SpryHTMLDataSet.js" type="text/javascript"></script>
<script type="text/javascript">
var ds1 = new Spry.Data.HTMLDataSet(null, "listings_name", {firstRowAsHeaders: false, columnNames: ['name']});
ds1.setColumnType("name", "html");
</script>
</head>

<body>
<div id="wrapper">
<table width="998" border="0" cellspacing="4" id="listings_name">
<?php do { ?>
<tr>
<td><?php echo $row_Recordset1['name']; ?></td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
<div id="spryTable" spry:region="ds1">
<table align="center">
<tr>
<th spry:sort="name">&nbsp;</th>
</tr>
<tr spry:repeat="ds1" spry:setrow="ds1" spry:hover="hover" spry:select="selected">
<td height="40" align="center">{name}</td>
<td height="40" align="center">{name}</td>
</tr>
</table>
</div>
</body>
</html>
Post Reply