Nooby Codeigniter user! MYSQL Query |
[eluser]mr daniel[/eluser]
Hullo guys So I've just been playing around with codeigniter and mysql. I need to execute the mysql query: Code: SELECT COUNT(id) FROM urls; So I've been trying something like Code: <php echo $idcount; ?> Code: $this->view_data['idcount'] = mysql_query(SELECT COUNT(id) FROM urls;); Is there an easy way to do this? I've been struggling so far Any help would be appreciated <3 EDIT: mistyped code
[eluser]jmadsen[/eluser]
There sure is. Here's the manual where they talk about how to use databases. http://ellislab.com/codeigniter/user-gui...index.html
[eluser]mr daniel[/eluser]
[quote author="jmadsen" date="1341823224"]There sure is. Here's the manual where they talk about how to use databases. http://ellislab.com/codeigniter/user-gui...index.html[/quote] Thanks very much! Trying it now but still struggling. Will keep going!
[eluser]mr daniel[/eluser]
All fixed and done Was as simple as using Code: <?php echo $this->db->count_all('urls'); ?> |
Welcome Guest, Not a member yet? Register Sign In |