Welcome Guest, Not a member yet? Register   Sign In
Nooby Codeigniter user! MYSQL Query
#1

[eluser]mr daniel[/eluser]
Hullo guys Smile


So I've just been playing around with codeigniter and mysql.
I need to execute the mysql query:
Code:
SELECT COUNT(id) FROM urls;
and want to show the result on the main page of my website.



So I've been trying something like
Code:
<php echo $idcount; ?&gt;
on the website and in my controller, "g.php" I've been using
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 Sad
Any help would be appreciated <3


EDIT: mistyped code


Messages In This Thread
Nooby Codeigniter user! MYSQL Query - by El Forum - 07-09-2012, 12:29 AM
Nooby Codeigniter user! MYSQL Query - by El Forum - 07-09-2012, 01:40 AM
Nooby Codeigniter user! MYSQL Query - by El Forum - 07-09-2012, 02:34 AM
Nooby Codeigniter user! MYSQL Query - by El Forum - 07-09-2012, 03:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB