Welcome Guest, Not a member yet? Register   Sign In
Count problem
#3

[eluser]alexaaaaaaaaaa[/eluser]
[quote author="techgnome" date="1285181499"]You'll want to include the year in that as well... other wise the projects posted in Sept of '08 will count against them too. And you may want to check for the num rows >= 2 ... if they have exactly 2, they will still be able to post using your current logic, bringing their total to 3.

-tg[/quote]

yeah your'r right but how can i translate that code into codeigniter

model:

function getprojects()
{
$this->db->from('projects');
$this->db->join('users', 'users.id = projects.programmer_id','left');

$this->db->select('projects.id,projects.project_name,projects.created,users.id as userid,projects.checkstamp,projects.provider_rated,projects.buyer_rated,projects.project_paid,projects.is_private,projects.flag');

$result = $this->db->get();

return $result;

}

controller
$this->outputData['myProjects'] = $this->skills_model->getprojects();

view:

if(isset($myProjects) and $myProjects->num_rows()>0)
{
foreach($myProjects->result() as $myProjects)
{
?>


<?php echo get_date($myProjects->created);?>

<?php } ?>


Messages In This Thread
Count problem - by El Forum - 09-22-2010, 04:33 AM
Count problem - by El Forum - 09-22-2010, 07:51 AM
Count problem - by El Forum - 09-22-2010, 08:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB