Note that there are some explanatory texts on larger screens.

plurals
  1. POexecute another function within function with data variables
    text
    copied!<p>need help on this one: </p> <p>here's a my sample code,<br> i would like to add a validation message if a preg_match occurs:<br> pls. see inline comments for more details.. </p> <pre><code>public function supplier_entry() { if (preg_match("/[\'^£@&amp;*...etc.../", $this-&gt;input-&gt;post('supplier'))) { //add or pass validation message, ex. $msg = 'Invalid Supplier Name'; // i tried $this-&gt;supplier_entry_form($msg); but its not working. $this-&gt;supplier_entry_form(); }else{ $post_data = array( 'supplier_name' =&gt;$this-&gt;input-&gt;post('supplier'), 'user' =&gt; $this-&gt;input-&gt;post('user'), 'trx_id' =&gt;$this-&gt;input-&gt;post('trx_id'), ); $this-&gt;load-&gt;model('user_model'); $this-&gt;load-&gt;model('product_model'); $this-&gt;product_model-&gt;add_new_supplier($post_data); $user_data['trx'] = 'Supplier Entry'; $user_data['username'] = $this-&gt;user_model-&gt;user_info(); $trx_data['supplier'] = $this-&gt;product_model-&gt;get_supplier_list(); $trx_data['msg'] = 'Supplier Posted.'; $this-&gt;load-&gt;view('header',$user_data); $this-&gt;load-&gt;view('item_supplier', $trx_data); } } </code></pre> <p>thanks in advance..</p> <pre><code> public function supplier_entry_form() { $this-&gt;load-&gt;model('user_model'); $this-&gt;load-&gt;model('product_model'); $user_data['username'] = $this-&gt;user_model-&gt;user_info(); $user_data['trx'] = 'Supplier Entry'; $trx_data['supplier'] = $this-&gt;product_model-&gt;get_supplier_list(); $this-&gt;load-&gt;view('header', $user_data); $this-&gt;load-&gt;view('item_supplier', $trx_data); } </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