Note that there are some explanatory texts on larger screens.

plurals
  1. POMysql inserts blank row after inserting row with data (in Chrome)
    text
    copied!<p><strong>Seems to be a browser issue, as in firefox it is working fine but not in chrome.</strong></p> <p>Why is it that when I submit my php form to insert data into a mysql db table, then check the table. I see my newly created row with the data in it and also an extra row with nothing in it?</p> <p><strong>My controller:</strong></p> <pre><code> function Admin() { parent::Controller(); $this-&gt;dx_auth-&gt;check_uri_permissions(); $this-&gt;load-&gt;model('alert_model'); $data['rows'] = $this-&gt;alert_model-&gt;check($num_results=4); $this-&gt;load-&gt;view('includes/header', $data); } function index() { $this-&gt;load-&gt;view('admin/notifications'); $this-&gt;load-&gt;view('includes/footer'); } function sendalert() { $info = array( 'msg_author' =&gt; $this-&gt;input-&gt;post('msg_author'), 'msg_date' =&gt; $this-&gt;input-&gt;post('msg_date'), 'msg_subject' =&gt; $this-&gt;input-&gt;post('msg_subject'), 'msg_content' =&gt; $this-&gt;input-&gt;post('msg_content') ); $this-&gt;send_notification-&gt;send($info); $this-&gt;index(); } </code></pre> <p><strong>My Model:</strong></p> <pre><code> function send($info) { $this-&gt;db-&gt;insert('msg', $info); return; } </code></pre> <p><strong>My View:</strong></p> <pre><code>&lt;?php echo form_open('admin/sendalert'); ?&gt; &lt;label for="msg_subject"&gt;Subject&lt;/label&gt; &lt;input type="text" name="msg_subject" id="msg_subject" /&gt; &lt;label for="msg_date"&gt;Date&lt;/label&gt; &lt;input type="text" name="msg_date" id="msg_date" /&gt; &lt;label for="msg_author"&gt;From&lt;/label&gt; &lt;input type="text" name="msg_author" id="msg_author" /&gt; &lt;label for="msg_content"&gt;Content&lt;/label&gt; &lt;input type="text" name="msg_content" id="msg_content" /&gt; &lt;input type="submit" value="submit" /&gt; &lt;?php echo form_close(); ?&gt; </code></pre> <p>Thanks</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