Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Unfortunately the only thing you can do is use HTML (and optionally CSS) to do this.</p> <p>Also you have some problems with your example code. '&amp;nbsp' should have a <code>;</code> at the end. I assume you mean <code>mysql_fetch_assoc()</code> and not <code>mysql_fetch_array()</code> since you're referencing the <code>$row</code> array with a string index rather than numerical?</p> <pre><code>$results = 0; $max_results = 26; while ($row = mysql_fetch_assoc($result)) { $results++; echo $row['line'] . "&amp;nbsp;"; if ($results % max_results == 0) echo "&lt;br /&gt;&lt;br /&gt;"; } </code></pre> <p>This will print out up to 25 space-separated results per line. This is very crude, but will work in the browser. Ideally, you should add supporting HTML tags such as html, body, etc...</p> <p>Also, as a side note: I understand that you are still learning, but please please PLEASE remember that whenever you accept any sort of external input in your SQL strings, you must must MUST sanitize them first. What if <code>$_POST['numberofsentences']</code> was equal to <code>0;DROP DATABASE db;</code>?</p> <p>If you're expecting the POST variable to be an integer, use <code>mysql_real_escape_string()</code> followed by <code>intval()</code>.</p> <hr> <p><strong>Edit:</strong> I didn't want to remove the mistake I made in my post about dot vs. comma since it's referenced in the comments below, but it seems it may cause some confusion if I leave it in here. You can <code>echo string1 . string2</code> or <code>echo string1, string2</code>. These both give the same output but work quite differently under-the-hood. To see the original post just look at the history.</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.
 

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