Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First off, I have no idea what your variable names mean. I've tried to guesstimate, but you should look into renaming them. To keep the sanity of your maintanence programmer.</p> <p>Looking at your code, I know what it's doing, but I have no idea what it's supposed to do, or why. Below is an attempt to rename your variable names, but I have no idea if it's even right, or close to right:</p> <hr> <pre><code>$story_query = "SELECT table_name, id FROM planning WHERE parent = '$novelnum'"; $story_result = db_query($story_query); while($story_row = db_fetch_array($story_result)) { $taleTable_Name = $story_row['table_name']; $postid[] = $story_row['id']; $query2 = "Select * from $taleTable_Name where approved='Y' order by id"; $bset2 = db_query($query2); while($rowset2 = db_fetch_array($bset2)) { $id[] = $rowset2['id']; $thread[] = $rowset2['thread']; $subject[] = $rowset2['subject']; $author[] = $rowset2['author']; $datetime[] = $rowset2['datestamp']; } } if(isset($datetime)) { $forumcount = count($datetime); if($forumcount &gt; 20) { $xs = $forumcount - 20; } else { $xs = 0; } for($postnum=$xs;$postnum&lt;$forumcount;$postnum++) { if($subject[$postnum] != "") { $newpost .= $datetime[$postnum]; $newpost .= " &lt;a href='../forums/read.php?f="; $newpost .= end($postid); $newpost .= "&amp;id="; $newpost .= $id[$postnum]; $newpost .= "&amp;thread="; $newpost .= $thread[$postnum]; $newpost .= "'&gt;" ; $newpost .= $subject[$postnum]; $newpost .= "&lt;/a&gt; by "; $newpost .= $author[$postnum]; $newpost .= $taleTable_Name; $newpost .= "&lt;br&gt;\n"; } } } else { $newpost = "There are no posts for this scroll yet."; } </code></pre> <hr> <p>What do the following variables mean? : <code>$xs</code>, <code>$c</code>, <code>&amp;i</code>, <code>&amp;t</code>, and <code>$fc</code>? These ought to be meaningful names. I've renamed your other variables, but for these I just guessed. I could be way off. Meaningful variable names go a long way to helping someone read code that doesn't have comments. As it is, if you had meaningful variable names, <a href="https://stackoverflow.com/questions/36432/commenting-code">I may not need comments</a> -- though what's the <a href="https://stackoverflow.com/questions/47882/what-is-a-magic-number-and-why-is-it-bad">magic number</a> of '20' doing? What is so meaningful about that number?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload