Skip to content
Advertisement

select max codeigniter

Im trying to get an max value with codeigniter from an table but it isnt working. This is the error i get:

Severity: 4096

Message: Object of class CI_DB_mysql_result could not be converted to string

Filename: database/DB_active_rec.php

Line Number: 427

This is my function:

JavaScript

What im trying to do is as followed:

  1. Select the highest id where bedrijf_id = $bedrijf_id from rapporten.
  2. Select the periode_nummer from statistieken_onderhoud where rapporten_id = the highest id i got from step 1.
  3. Add 1 to the periode_nummer i got from step 2 and return that number.

Thanks in forward for your help!

Advertisement

Answer

Try

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement