Skip to content
Browse files

More changes to index

  • Loading branch information...
1 parent 70fe3bf commit 1d4eb2e258390b347082fa7c3e273907025f4071 @tovanor committed
Showing with 6 additions and 4 deletions.
  1. +6 −4 index.php
View
10 index.php
@@ -30,18 +30,20 @@
// find all threads in progress
echo "Incomplete Threads: ";
-$incomplete_threads = $c_mysqli->query("SELECT * FROM `threads` WHERE `num_turns` < 10");
+$incomplete_threads = $c_mysqli->query("SELECT * FROM `threads` WHERE `num_turns` < 10 LIMIT 20");
while($i = $incomplete_threads->fetch_object()) {
$first_thread = $c_mysqli->query("SELECT * FROM `turns` WHERE `thread_id` = '$i->id' AND `turn_number` = '1' LIMIT 1");
- $ft = $first_thread->fetch_object();
- echo '<a href="showthread.php?id=' . $i->id . '">' . $ft->content . '</a><br />';
+ if($first_thread->num_rows) {
+ $ft = $first_thread->fetch_object();
+ echo '<a href="showthread.php?id=' . $i->id . '">' . $ft->content . '</a><br />';
+ }
}
echo "<br /><br />";
// find and display all completed threads
echo "Completed Threads:<br />\n";
-$completed_threads = $c_mysqli->query("SELECT * FROM `threads` WHERE `num_turns` = 10");
+$completed_threads = $c_mysqli->query("SELECT * FROM `threads` WHERE `num_turns` = 20");
while($t = $completed_threads->fetch_object()) {
$first_thread = $c_mysqli->query("SELECT * FROM `turns` WHERE `thread_id` = '$t->id' AND `turn_number` = '1' LIMIT 1");
$ft = $first_thread->fetch_object();

0 comments on commit 1d4eb2e

Please sign in to comment.
Something went wrong with that request. Please try again.