Note that there are some explanatory texts on larger screens.

plurals
  1. POMessage : Undefined Variable userid , workspaceid
    primarykey
    data
    text
    <p>I am working on a view that show's me the data from the database using joins in textbox.</p> <p>Now I get the error: </p> <pre><code>Message: Undefined variable: userid Message: Undefined variable: workspaceid </code></pre> <p>Following is my model, View and Controller</p> <p><strong>Model :-</strong></p> <pre><code>function getMilestone($taskid, $userid,$workspaceid, $is_master_admin) { $this-&gt;load-&gt;database(); if($is_master_admin) { $this-&gt;db-&gt;select('user.title as usertitle, workspace.title as workspacetitle,workspace.id as workspaceid,task.title as tasktitle,task.id as taskid, milestone.*');//task.title as tasktitle,task.id as taskid, } else { $this-&gt;db-&gt;select('*'); } $this-&gt;db-&gt;from(MILESTONE); if($is_master_admin) { $this-&gt;db-&gt;join(USER, 'milestone.userid = user.id', 'inner'); $this-&gt;db-&gt;join(WORKSPACE, 'workspace.id = milestone.workspaceid','inner'); $this-&gt;db-&gt;join(TASK, 'task.id = milestone.taskid', 'inner'); } else { } $this-&gt;db-&gt;where('taskid', $taskid); if($is_master_admin) { $this-&gt;db-&gt;order_by("userid", "asc"); } else { $this-&gt;db-&gt;where('userid', $userid); } $query = $this-&gt;db-&gt;get(); if ($query-&gt;num_rows() &gt; 0) { return $query-&gt;result(); } else { return false; } } </code></pre> <p><strong>Controller :-</strong></p> <pre><code>function addNew($taskid) { if ($this-&gt;session-&gt;userdata('logged_in')) { $session_data = $this-&gt;session-&gt;userdata('logged_in'); $id = $session_data['id']; $username = $session_data['username']; $is_master_admin = $session_data['master']; $imagethumb = $session_data['imagethumb']; $pendingbug = $this-&gt;bugmodel-&gt;getBug($id,$is_master_admin); $pendingtask = $this-&gt;taskmodel-&gt;getTask($id,$is_master_admin); $status_result = $this-&gt;getstatus-&gt;getEnumValues(MILESTONE,'status'); $result = $this-&gt;milestonemodel-&gt;getMilestone($taskid, $userid, $workspaceid, $is_master_admin) ; $data=''; $data = array('username' =&gt; $username, 'is_master_admin' =&gt; $is_master_admin, 'imagethumb' =&gt; $imagethumb, 'result' =&gt; $result, 'status_result' =&gt; $status_result, 'taskid' =&gt; $taskid, 'pendingtask' =&gt; $pendingtask, 'pendingbug' =&gt; $pendingbug ); $this-&gt;load-&gt;view('milestone/add_milestone', $data); } else { //If no session, redirect to login page redirect('login', 'refresh'); } } </code></pre> <p><strong>View :-</strong></p> <pre><code>&lt;div class="control-group"&gt; &lt;label class="control-label"&gt;Title&lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt; &lt;div class="controls"&gt; &lt;input type="text" name="title" data-required="1" class="span6 m-wrap" readonly="readonly"value="&lt;?php echo $result[0]-&gt;taskid; ?&gt;"/&gt; &lt;p&gt;&lt;?php echo form_error('title'); ?&gt;&lt;/p&gt; &lt;input type="hidden" id="tasktype" name="tasktype" data-required="1" class="span2 m-wrap" value="&lt;?php //echo $task_type ?&gt;"/&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="control-group"&gt; &lt;label class="control-label"&gt;Workspace&lt;/label&gt; &lt;div class="controls"&gt; &lt;input type="text" readonly="readonly" value="&lt;?php echo $result[0]-&gt;workspacetitle; ?&gt;"&gt;&lt;/input&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>In my View value is printing using taskid; ?> &amp; workspacetitle; ?> on text box but error is printed on top of the page</p>
    singulars
    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