Jump to content

accessing MySQL from cake php


hsekar

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.