Please find below my coding. I have tried to reduce it as small as possible, since it is very long. My problem is when I am doing an echo of the coloumn Question, I am getting it out of format as shown in the earlier post... Any suggestions???
<?php
/ Connecting, selecting database /
// get the total number of records
$page1 = $_GET['by'];
$page = $page1 ;
if ($page < 1) {
$page = 1 ;
}
$limit = 2;
$sort = ((($page-1) $limit) ) ;
$result = mysql_query("SELECT DISTINCT count( ) FROM Teasers WHERE 'Sl no' <> '0'");
$num = mysql_result($result, 0, 0);
$total = ceil($num / $limit);
$offset = $sort ;
/ Performing SQL query /
$query = "SELECT DISTINCT Question FROM Teasers WHERE 'Sl no' > \"$sort\" LIMIT $offset, $limit ";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
/ Printing results in HTML /
?>
<?php
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
if (($x % 2) == 0) {
?>
<TR><td bgcolor="#C8DBDF">
<?php
}
else {
?>
<TR><td bgcolor="#CCCCCC">
<?php
}
echo "<font face=arial size=-1>$x".") " ;
echo "<font face=arial size=-1>".$line['Question']."" ;
echo "<p> </p>";
$pass = ($x + ($page - 1) $limit) ;
$save = $page ;
$save .= "" ;
$save .= $pass ;
echo "<a href='/answers.php?by=".$save." '><font face=arial size=-.35>Click here for answer</a>";
?>
</td></TR></p>
<?php
$x++;
if ($x==20){
$page++;
}
}