<?php $reload = $_SERVER['PHP_SELF'] . "?tpages=" . $tpages; echo '<div class="pagination"><ul>'; if ($total_pages > 1) { echo paginate($reload, $show_page, $total_pages); } echo "</ul></div>"; // display data in table echo "<table class='imagetable'>"; echo "<thead><tr><th>Title</th> <th>Last Date</th><th>View Details</th></tr></thead>"; // loop through results of database query, displaying them in the table for ($i = $start; $i < $end; $i++) { // make sure that PHP doesn't try to show results that don't exist if ($i == $total_results) { break; } // echo out the contents of each row into a table echo '<td>' . mysql_result($result, $i, 'title') . '</td>'; echo '<td>' . mysql_result($result, $i, 'date') . '</td>'; echo '<td><a href="' . mysql_result($result, $i, "viewpost.php"?id=<?php echo '$row[0]'?>) . '"></td>'; echo "</tr>"; } // close table> echo "</table>"; // pagination ?>
在viewpost.php遇到错误,任何人都可以帮助我。
我不知道这是什么意思
mysql_result($result, $i, "viewpost.php"?id=<?php echo '$row[0]'?>)
到
mysql_result($result, $i, "columnname")."?id=".$row[0]);
尝试#2
$pageId=mysql_result($result, $i, 'id');
echo '<td><a href="test.php?id='.$pageId.'"></td>';
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句