Note that there are some explanatory texts on larger screens.

plurals
  1. POcodeigniter form
    primarykey
    data
    text
    <p>i was tired after 3 day searching.. can somebody tell me or show me an example how to upload text with image?</p> <pre><code>my table: name -&gt; varchar lastname -&gt; varchar position -&gt; varchar pass_id -&gt; int image_url -&gt; varchar </code></pre> <p>this is a form_view file</p> <pre><code>&lt;h2&gt;Create&lt;/h2&gt; &lt;?php echo form_open('main/add'); ?&gt; &lt;p&gt; &lt;label for="name"&gt;Name:&lt;/label&gt; &lt;input type="text" name="name" id="name" /&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="lastname"&gt;Lastname:&lt;/label&gt; &lt;input type="text" name="lastname" id="lastname" /&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="position"&gt;Position:&lt;/label&gt; &lt;input type="text" name="position" id="position" /&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="name"&gt;Passport ID:&lt;/label&gt; &lt;input type="text" name="pass_id" id="pass_id" /&gt; &lt;/p&gt; &lt;input type="file" name="userfile" size="20" /&gt; &lt;input type="submit" value="Submit" /&gt; &lt;?php echo form_close(); ?&gt; </code></pre> <p>this is a controller file:</p> <pre><code>public function add() { $subject = array( 'name' =&gt; $this-&gt;input-&gt;post('name'), 'lastname' =&gt; $this-&gt;input-&gt;post('lastname'), 'position' =&gt; $this-&gt;input-&gt;post('position'), 'pass_id' =&gt; $this-&gt;input-&gt;post('pass_id') ); $this-&gt;main_model-&gt;add($subject); $this-&gt;index(); } </code></pre> <p>and a model file:</p> <pre><code>public function add($object) { $this-&gt;db-&gt;insert('stuf', $object); return; } </code></pre> <p>how to upload image url in the db.</p> <p>i'm newbie in CI. thanks</p>
    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.
 

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