如何通过从我的观点得到变量的控制器和模型也再装到我的观点 无需使用形式的像传得变量笨
$jcid= $row['id']; // this id from other table which is parent.
$s = "SELECT * FROM `jobs` WHERE job_cat=$jcid";
$re = mysql_query($s);
$no = mysql_num_rows($re);
echo $no;
在此先感谢
阿米特
如何通过从我的观点得到变量的控制器和模型也再装到我的观点 无需使用形式的像传得变量笨
$jcid= $row['id']; // this id from other table which is parent.
$s = "SELECT * FROM `jobs` WHERE job_cat=$jcid";
$re = mysql_query($s);
$no = mysql_num_rows($re);
echo $no;
在此先感谢
阿米特
而是使用get PARAM使用这样
的这可能是你的表单URL
http://example.com/index.php/news/local/metro/crime_is_up
$this->uri->segment(3); // Will give you news
像代替3 4取代明智会给你地铁等。你可以在控制器中访问它。
在笨Uri类
http://ellislab.com/codeigniter/user-guide/libraries/uri.html
首先使用
$this->load->helper('url');
然后
$data['$jcid'] = $this->uri->segment(3);
如果你询问如何获取得到的变量,你可能想看看这个。 http://ellislab.com/forums/viewthread/139807/#689150 –
你的问题不清楚。 –
我有一个根据工作类别添加工作的工作类别列表,所以我做了2个工作表,即job_cat和job_cat中的工作,我已经从那个工具提取了所有的值现在我想要特定工作的计数,说特定工作itjobs (0)如果作业中没有作业tbl如果它们应该更新为1或更多,因为作业是他们的作业类别。所以我想通过它的pkey工作tbl有foregin关键字我应该怎么做codeigniter感谢耐心阅读我的描述 – user2610240