Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Or just pass it to the function.</p> <pre><code>$template = file_get_contents("main.tpl.php"); function updateForm($id, $template) { $query = "SELECT * FROM platen WHERE ID =". $id; $result = mysql_query($query) or die (mysql_error()); while($row = mysql_fetch_array($result)) { $editForm = "&lt;form action='index.php?update&amp;id=". $row['ID'] ."' method='post'&gt;"; $editForm .= "&lt;label for='id'&gt;&lt;span&gt;ID:&lt;/span&gt;&lt;/label&gt; &lt;input name='id' id='id' type='text' value='". $row['ID'] ."'&gt;&lt;/br&gt;"; $editForm .= "&lt;label for='album'&gt;&lt;span&gt;Album:&lt;/span&gt;&lt;/label&gt; &lt;input name='album' id='album' type='text' value='". $row['Album'] ."'&gt;&lt;/br&gt;"; $editForm .= "&lt;label for='band'&gt;Band:&lt;/label&gt; &lt;input name='band' id='band' type='text' value='". $row['Band'] ."'&gt;&lt;/br&gt;"; $editForm .= "&lt;label for='stijl'&gt;Stijl:&lt;/label&gt; &lt;input name='stijl' id='stijl' type='text' value='". $row['Stijl'] ."'&gt;&lt;/br&gt;"; $editForm .= "&lt;label for='medium'&gt;Medium:&lt;/label&gt; &lt;input name='medium' id='medium' type='text' value='". $row['Medium'] ."'&gt;&lt;/br&gt;"; $editForm .= "&lt;label for='datum'&gt;Datum:&lt;/label&gt; &lt;input name='datum' id='datum' type='text' value='". $row['Datum'] ."'&gt;&lt;/br&gt;"; $editForm .= "&lt;label for='prijs'&gt;Prijs:&lt;/label&gt; &lt;input name='prijs' id='prijs' type='text' value='". $row['Prijs'] ."'&gt;&lt;/br&gt;"; $editForm .= "&lt;input class='submit' type='submit' value='Update'&gt;"; $editForm .= "&lt;/form&gt;"; } $template = str_replace("%%editForm%%", $editForm, $template); } </code></pre>
 

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