Maximum value of ID being used
-
I’m using a loop to modify some of my field values.
I’m looping from an id=1 up to an arbitrary value of 1000.
Rather than using the arbitrary value of 1000, is there a way I can determine the maximum value of id that is currently in place in PDB.for($i=1; $i<=1000; $i++) {
$data=Participants_Db::get_participant($i);
$user_id = $data[‘id’];
$username = $data[‘username’];
$boatname = $data[‘boat_name’];
if(!empty($username)) {
if (empty($boatname)) {
echo $username.’:’.$boatname.'<br>’;
$data = array();
$data[‘id’]=$user_id;
$data[‘username’]=$username;
$data[‘boat_name’]=’Name Needed’;
Participants_Db::write_participant($data);
}
}
}
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Maximum value of ID being used’ is closed to new replies.