RaythXC
<?php echo "
".$row_NewsDisp['news_article']."
"; ?>
Not working. Is there anymore info I can give you - the whole page perhaps.
Hate it when something so simple doesn’t seem to work. The very page has that code because I inserted text and submitted. I’m going to ‘view source’ but in the meantime friends, lets help each other…today, me!
[php]<?php require_once('../Connections/Drjacha.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;
}
}
$currentPage = $_SERVER["PHP_SELF"];
$maxRows_NewsDisp = 5;
$pageNum_NewsDisp = 0;
if (isset($_GET['pageNum_NewsDisp'])) {
$pageNum_NewsDisp = $_GET['pageNum_NewsDisp'];
}
$startRow_NewsDisp = $pageNum_NewsDisp * $maxRows_NewsDisp;
mysql_select_db($database_Drjacha, $Drjacha);
$query_NewsDisp = "SELECT news_ID, news_title, news_date, news_article FROM news ORDER BY news_ID DESC";
$query_limit_NewsDisp = sprintf("%s LIMIT %d, %d", $query_NewsDisp, $startRow_NewsDisp, $maxRows_NewsDisp);
$NewsDisp = mysql_query($query_limit_NewsDisp, $Drjacha) or die(mysql_error());
$row_NewsDisp = mysql_fetch_assoc($NewsDisp);
if (isset($_GET['totalRows_NewsDisp'])) {
$totalRows_NewsDisp = $_GET['totalRows_NewsDisp'];
} else {
$all_NewsDisp = mysql_query($query_NewsDisp);
$totalRows_NewsDisp = mysql_num_rows($all_NewsDisp);
}
$totalPages_NewsDisp = ceil($totalRows_NewsDisp/$maxRows_NewsDisp)-1;
$queryString_NewsDisp = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_NewsDisp") == false &&
stristr($param, "totalRows_NewsDisp") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_NewsDisp = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_NewsDisp = sprintf("&totalRows_NewsDisp=%d%s", $totalRows_NewsDisp, $queryString_NewsDisp);
?>
Untitled Document
.MainContent {
font-family: Verdana, Geneva, sans-serif;
font-size: 11px;
color: #CCC;
font-style: normal;
}
.PicBoder_white {
border-top-width: thick;
border-right-width: thick;
border-bottom-width: 12px;
border-left-width: thick;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: #999;
border-right-color: #999;
border-bottom-color: #999;
border-left-color: #999;
}
body {
background-color: #333;
}
|
|
<?php do { ?>
<tr>
<td><?php echo $row_NewsDisp['news_title']; ?></td>
</tr>
<tr>
<td class="MainContent"><?php echo $row_NewsDisp['news_date']; ?></td>
</tr>
<tr>
<td class="NewsArticle"><?php echo "<p style='font-weight: bold;'>".$row_NewsDisp['news_article']."</p><br/>"; ?>
</td>
</tr>
<tr>
<td class="NewsArticle"><table border="0" cellpadding="5">
<tr>
<td width="102"><?php if ($pageNum_NewsDisp > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_NewsDisp=%d%s", $currentPage, 0, $queryString_NewsDisp); ?>">First 5 Articles</a>
<?php } // Show if not first page ?></td>
<td width="130" bgcolor="#999999"><?php if ($pageNum_NewsDisp > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_NewsDisp=%d%s", $currentPage, max(0, $pageNum_NewsDisp - 1), $queryString_NewsDisp); ?>">Previous 5 Articles</a>
<?php } // Show if not first page ?></td>
<td width="103"><?php if ($pageNum_NewsDisp < $totalPages_NewsDisp) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_NewsDisp=%d%s", $currentPage, min($totalPages_NewsDisp, $pageNum_NewsDisp + 1), $queryString_NewsDisp); ?>">Next 5 Articles</a>
<?php } // Show if not last page ?></td>
<td width="56" bgcolor="#006699"><?php if ($pageNum_NewsDisp < $totalPages_NewsDisp) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_NewsDisp=%d%s", $currentPage, $totalPages_NewsDisp, $queryString_NewsDisp); ?>">Last</a>
<?php } // Show if not last page ?></td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="219" border="0" cellpadding="0" bgcolor="#FFFFFF">
<tr>
<td width="63"> </td>
<td width="41"><a href="news_insert.php">Edit</a></td>
<td width="84"><a href="../index.php" target="_blank">View Update</a></td>
</tr>
</table></td>
</tr>
<?php } while ($row_NewsDisp = mysql_fetch_assoc($NewsDisp)); ?>
</table></td>
<td valign="top"><span class="newstitle"><img src="../images/reader1.jpg" alt="Spirit Of A Champion" width="200" height="233" class="PicBoder_white" /></span></td>
|
|
|
|
<?php
mysql_free_result($NewsDisp);
?>
[/php] |