php output to ajax script problem
Posted: Wed Jun 30, 2010 7:05 am
I am returning output from a php file to an ajax script. I have the php file echo a table, which is formatted properly. The problem is, when the text returns from the php file, the content inside the table footer is on top of the table. Really weird.
My Code:
Output Code:

My Code:
Code: Select all
$table;
$table .= "<table id='pageme'><thead><tr><th align='center'>Request #</th><th align='center'>Date</th><th align='center'>Subject</th><th align='center'>Status</th></tr></thead><tbody>";
$get = mysql_query("SELECT * FROM support WHERE customer='$num' LIMIT $start,$perpage");
while($row = mysql_fetch_row($get)) {
$table .= "<tr><td align='center'>$row[0]</td><td>$row[1]</td><td>$row[3]</td><td>$row[5]</td></tr>";
}
$previous = $start - $perpage;
$next = $start + $perpage;
$table .= "</tbody><tfoot><tr>";
if (!($start<=0)) {
$table .= "<a onclick=\"LoadPage('widgets.php?start=$previous');\">prev</a>";
}
$i = 1;
for ($x=0;$x<$num_rows;$x+=$perpage) {
if ($start != $x)
$table .= "<a onclick=\"LoadPage('widgets.php?start=$x');\">$i</a>";
else
$table .= "<b>$i</b>";
$i++;
}
if (!($start>=($num_rows-$perpage))) {
$table .= "<a onclick=\"LoadPage('widgets.php?start=$next');\">next</a>";
}
$table .= "</tr></tfoot></table>";
echo $table;Output Code:
