This topic is locked

Load the last value added

11/16/2013 11:20:04 AM
PHPRunner General questions
J
joiresende author

hello

I need to move to a field the last value added in a given field, in the example below I use the id field considering the maximum value, only need to add a value variable, ie the last value added and not the greatest. would this be possible?
example:
$rs = CustomQuery("select max(".AddFieldWrappers("id").") as max_number from ".AddTableWrappers("total"));

$data = db_fetch_array($rs);

if ($data) {

$values['id'] = $data['max_number'] + 1;

}