Note that there are some explanatory texts on larger screens.

plurals
  1. POMySQL Update entire table in one query
    primarykey
    data
    text
    <p>I'm trying to load and update the content of a entire table. I have no problem loading the data but it won't update.. Can someone tell me what I'm doing wrong here:</p> <pre><code>while($show_table = mysql_fetch_array($result_table)){ echo "&lt;tr&gt;&lt;td&gt;&lt;input type='text' name='table_id' value='" . $show_table["id"] . "'/&gt;&lt;input type='text' name='table_date' value='" . $show_table["date"] . "'/&gt; &lt;/td&gt;&lt;td&gt;&amp;euro; &lt;input type='text' name='table_week' value='" . $show_table["week"] . "'/&gt; &lt;/td&gt;&lt;td&gt;&amp;euro; &lt;input type='text' name='table_midweek' value='" . $show_table["midweek"] . "'/&gt; &lt;/td&gt;&lt;td&gt;&amp;euro; &lt;input type='text' name='table_weekend' value='" . $show_table["weekend"] . "'/&gt; &lt;/td&gt;&lt;td&gt;&lt;input type='text' name='table_type' value='" . $show_table["type"] . "'/&gt; &lt;/td&gt;&lt;td&gt;&lt;input type='text' name='table_information' value='" . $show_table["information"] . "'/&gt;&lt;/td&gt;&lt;/tr&gt;"; } echo "&lt;/table&gt; &lt;p&gt;&lt;input type='submit' id='form_submit' name='update_confirm' value='Tarieven bijwerken'&gt;&lt;/p&gt; &lt;/form&gt;"; if ($_POST['update_confirm'] == 'Tarieven bijwerken') { $id = $_POST['table_id']; $date = $_POST['table_date']; $week = $_POST['table_week']; $midweek = $_POST['table_midweek']; $weekend = $_POST['table_weekend']; $type = $_POST['table_type']; $information = $_POST['table_information']; $update_table = "UPDATE tarieven SET date='$date', week='$week', midweek='$midweek', weekend='$weekend', type='$type', information='$information' WHERE id='$id';"; $confirm_table = mysql_query($update_table); } else { } </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.
 

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