hsekar Posted February 22, 2008 Share Posted February 22, 2008 Hi All...... i wanted to know if there is a way of accessing the results of a query from Cake PHP. This is my code $query = $this->Webapp->query("SELECT count(*) as count from webapps where mutId='$jobid'"); $cleaned_query = escapeshellcmd($query); $query_out = mysql_query($cleaned_query); How do I know what the count is now . How can I store the count in another variable. Need Help....its urgent ! Link to comment https://forums.phpfreaks.com/topic/92504-accessing-mysql-from-cake-php/ Share on other sites More sharing options...
Neptunus Maris Posted February 22, 2008 Share Posted February 22, 2008 Cake is bad...bad... Link to comment https://forums.phpfreaks.com/topic/92504-accessing-mysql-from-cake-php/#findComment-473984 Share on other sites More sharing options...
KrisNz Posted February 22, 2008 Share Posted February 22, 2008 Theres a findCount function, I think it would look something like this $count = $this->Webapp->findCount(array("mutId"=>$jobid)); Your 2nd and 3rd lines of code baffle me though. You should read the manual page for escapeshellcmd(), since it's for an entirely different purpose than the one you're using it for. Go through the cake tutorials also. Link to comment https://forums.phpfreaks.com/topic/92504-accessing-mysql-from-cake-php/#findComment-474102 Share on other sites More sharing options...
hsekar Posted February 29, 2008 Author Share Posted February 29, 2008 thanks a lot Krisnz...yeah i went thru the manual for the escapeshellcmd..... i m new to php. thanks a lot for the help. Link to comment https://forums.phpfreaks.com/topic/92504-accessing-mysql-from-cake-php/#findComment-480439 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.