Hi Sid,
I have created 2 scripts.
http://www.chandospublishing.com/catalogue/test.php
test.php uses
$maxRows_DetailRS1 = 1;
$pageNum_DetailRS1 = 0;
if (isset($_GET['pageNum_DetailRS1'])) {
$pageNum_DetailRS1 = $_GET['pageNum_DetailRS1'];
}
$startRow_DetailRS1 = $pageNum_DetailRS1 * $maxRows_DetailRS1;
$colname_DetailRS1 = "1";
if (isset($_GET['category'])) {
$colname_DetailRS1 = (get_magic_quotes_gpc()) ? $_GET['category'] : addslashes($_GET['category']);
}
mysql_select_db($database_Chandos, $Chandos);
$recordID = $_GET['recordID'];
$query_DetailRS1 = sprintf("SELECT * FROM chandos_books WHERE ID = 4", $colname_record_filter);
$query_limit_DetailRS1 = sprintf("%s LIMIT %d, %d", $query_DetailRS1, $startRow_DetailRS1, $maxRows_DetailRS1);
$DetailRS1 = mysql_query($query_limit_DetailRS1, $Chandos) or die(mysql_error());
$row_DetailRS1 = mysql_fetch_assoc($DetailRS1);
if (isset($_GET['totalRows_DetailRS1'])) {
$totalRows_DetailRS1 = $_GET['totalRows_DetailRS1'];
} else {
$all_DetailRS1 = mysql_query($query_DetailRS1);
$totalRows_DetailRS1 = mysql_num_rows($all_DetailRS1);
}
$totalPages_DetailRS1 = ceil($totalRows_DetailRS1/$maxRows_DetailRS1)-1;
<!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>
mysql_select_db($database_Chandos, $Chandos);
$recordID = $_GET['recordID'];
$query_DetailRS1 = mysql_query("SELECT * FROM chandos_books WHERE book_title = '$recordID'");
$row= mysql_fetch_array($query_DetailRS1);
if (strlen ($row['content']) == 0)
{ echo "";
}
elseif (strstr ($row['content'], "*"))
{
$broken = explode("*", $row['content']);
$countbroken = count($broken);
echo "<uL>";
FOR($i = 0; $i < $countbroken; $i++){
echo "<LI>".$broken[$i]."</LI>";
}
echo "</uL>";
}
else
{
echo $row['content'];
}
?>
</body>
</html>
And http://www.chandospublishing.com/catalogue/test1.php
uses:
$maxRows_DetailRS1 = 1;
$pageNum_DetailRS1 = 0;
if (isset($_GET['pageNum_DetailRS1'])) {
$pageNum_DetailRS1 = $_GET['pageNum_DetailRS1'];
}
$startRow_DetailRS1 = $pageNum_DetailRS1 * $maxRows_DetailRS1;
$colname_DetailRS1 = "1";
if (isset($_GET['category'])) {
$colname_DetailRS1 = (get_magic_quotes_gpc()) ? $_GET['category'] : addslashes($_GET['category']);
}
mysql_select_db($database_Chandos, $Chandos);
$recordID = $_GET['recordID'];
$query_DetailRS1 = sprintf("SELECT * FROM chandos_books WHERE ID = 4", $colname_record_filter);
$query_limit_DetailRS1 = sprintf("%s LIMIT %d, %d", $query_DetailRS1, $startRow_DetailRS1, $maxRows_DetailRS1);
$DetailRS1 = mysql_query($query_limit_DetailRS1, $Chandos) or die(mysql_error());
$row_DetailRS1 = mysql_fetch_assoc($DetailRS1);
if (isset($_GET['totalRows_DetailRS1'])) {
$totalRows_DetailRS1 = $_GET['totalRows_DetailRS1'];
} else {
$all_DetailRS1 = mysql_query($query_DetailRS1);
$totalRows_DetailRS1 = mysql_num_rows($all_DetailRS1);
}
$totalPages_DetailRS1 = ceil($totalRows_DetailRS1/$maxRows_DetailRS1)-1;
<!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>
mysql_select_db($database_Chandos, $Chandos);
$recordID = $_GET['recordID'];
$query_DetailRS1 = mysql_query("SELECT * FROM chandos_books WHERE book_title = '$recordID'");
$row = mysql_fetch_array($query_DetailRS1);
if (strlen ($row_DetailRS1['content']) == 0)
{ echo "";
}
elseif (strstr ($row_DetailRS1['content'], "*"))
{
$broken = explode("*", $row_DetailRS1['content']);
$countbroken = count($broken);
echo "<uL>";
FOR($i = 0; $i < $countbroken; $i++){
echo "<LI>".$broken[$i]."</LI>";
}
echo "</uL>";
}
else
{
echo $row_DetailRS1['content'];
}
</body>
</html>
Can you try them out and see what you think.
I now have this working as it should useing the test1.php script.
If $row_DetailRS1" is empty, its does not show a bullet point.
If $row_DetailRS1" has a "" in it, it displays the data in bullet points.
If $row_DetailRS1 does not have any "" in it, it displays a normal string.
Thanks for all your help and advice.
Thanks.