Note that there are some explanatory texts on larger screens.

plurals
  1. POResult of MySQL query coming up blank
    text
    copied!<p>I've been coming in here for a while now, but this is the first time I post. So here it goes:</p> <p>I'm creating a DB for my website. So far, everything's going fine and working right. But when creating the .php to show comments, it's as if the echo is not there at all.</p> <p>The code is working just fine, because I don't get any errors on any of the possible results. But in those where there should be results, nothing shows up...</p> <p>here's my code:</p> <pre><code>&lt;?php $pickstory=$_POST['pickstory']; $result = mysql_query("SELECT name, comment FROM originalwork WHERE story = '$pickstory'", $conexion); if($fila= mysql_fetch_row($result)!=0){ ?&gt; &lt;?php echo "&lt;h6&gt;Comments on $pickstory&lt;/h6&gt;"; ?&gt; &lt;table width="900"&gt; &lt;tr&gt; &lt;td width="159" align="left" valign="top"&gt;&lt;/td&gt; &lt;td width="729"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;?php while ($fila= mysql_fetch_row($result)) { ?&gt; &lt;tr&gt; &lt;td&gt;&lt;?php echo "&lt;h2&gt;Name: $fila[0]&lt;/h2&gt;"; ?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo "&lt;p&gt;$fila[1]&lt;/p&gt;"; }?&gt;&lt;/td&gt; &lt;/tr&gt; &lt;?php } else { echo "&lt;h5&gt;No comments on $pickstory so far. Be the first!&lt;/h5&gt;"; } ?&gt; &lt;/table&gt; &lt;?php mysql_free_result($result); mysql_close(); ?&gt; </code></pre> <p>Like I said, the code works and I don't get any errors. And when there are no results, it shows me the message "no comments...". All good. The problem is, nothing shows when there are results to show. Help, please??</p>
 

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