Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As others have said, use jQuery to load an HTML snippet into a <code>div</code>. Since you already have a complete HTML document, the text you load should not be a full HTML document - just the HTML you would need if you'd loaded it into the <code>div</code> to start with.</p> <p>I wonder if I could offer some advice - not related to the question! - which you might find useful. As your application gets more complex, you'll find it neater to keep your logic and your presentation code separate - even if to start with, you just put the former at the start of the PHP document, and the latter at the end. As you learn more about PHP, you'll find it is a good idea to have these as separate files and load the 'template' in using <code>require_once</code>.</p> <p>If you do this, you'll find that the way you write PHP differs between logic and template. For the template, it helps to keep each PHP statement in a single PHP block, so essentially the document remains as HTML. This is neater, and helps take advantage of the syntax colouring and tag validation inside an IDE. Thus, I would write your template this way:</p> <pre><code>&lt;?php // Move this 'logic' code out of the way of your view layer // Here, the brace form of loops is preferred // Ideally it'd get moved to a different file entirely $con = mysqli_connect("localhost","root","","collofnursing"); mysql_select_db("collofnursing"); $res = mysqli_query($con,"select * from condwetreat"); ?&gt;&lt;html&gt; &lt;head&gt; &lt;title&gt; Conditions We Treat &lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;!-- The PHP 'tags' are now easier to indent --&gt; &lt;!-- So use while/endwhile, foreach/endforeach etc --&gt; Hi &lt;?php while($row = mysqli_fetch_array($res)): ?&gt; &lt;!-- So it's HTML to style stuff, rather than putting HTML tags into PHP echo statements :) --&gt; &lt;p class="symptom"&gt; &lt;?php echo $row['symptom'] ?&gt; &lt;/p&gt; &lt;?php endwhile ?&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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. 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