I have
try{
$sql = "SELECT bay_id,x_coord,y_coord,width,height FROM bays WHERE column_id = ".$_POST['row_id'];
echo $sql."<br>";
$result = $pdo->query($sql);
if($result->rowCount() > 0){
while($row = $result->fetch()){
echo "old coordinates: " . (int)$row['x_coord'].','. (int)$row['y_coord']."<br>";
try{
$sql = "UPDATE bays SET x_coord = ".$new_x.", y_coord = ".$new_y.",width = ".$new_width.",height = ".$new_height.", updated_by = '".$_SESSION['email']."',updated_date = CURRENT_TIMESTAMP WHERE column_id = ".$_POST['row_id'];
echo $sql."<br>";
producing
SELECT bay_id,x_coord,y_coord,width,height FROM bays WHERE column_id = 1
old coordinates: 153,99
UPDATE bays SET x_coord = 203, y_coord = 99,width = 18,height = 24, updated_by = ‘ssam@industechnology.com’,updated_date = CURRENT_TIMESTAMP WHERE column_id = 1
old coordinates: 153,117
UPDATE bays SET x_coord = 203, y_coord = 99,width = 18,height = 24, updated_by = ‘ssam@industechnology.com’,updated_date = CURRENT_TIMESTAMP WHERE column_id = 1
old coordinates: 153,135
UPDATE bays SET x_coord = 203, y_coord = 99,width = 18,height = 24, updated_by = ‘ssam@industechnology.com’,updated_date = CURRENT_TIMESTAMP WHERE column_id = 1
old coordinates: 153,153
UPDATE bays SET x_coord = 203, y_coord = 99,width = 18,height = 24, updated_by = ‘ssam@industechnology.com’,updated_date = CURRENT_TIMESTAMP WHERE column_id = 1
old coordinates: 153,171
UPDATE bays SET x_coord = 203, y_coord = 99,width = 18,height = 24, updated_by = ‘ssam@industechnology.com’,updated_date = CURRENT_TIMESTAMP WHERE column_id = 1
old coordinates: 153,189
UPDATE bays SET x_coord = 203, y_coord = 99,width = 18,height = 24, updated_by = ‘ssam@industechnology.com’,updated_date = CURRENT_TIMESTAMP WHERE column_id = 1
old coordinates: 153,207
UPDATE bays SET x_coord = 203, y_coord = 99,width = 18,height = 24, updated_by = ‘ssam@industechnology.com’,updated_date = CURRENT_TIMESTAMP WHERE column_id = 1
old coordinates: 153,225
UPDATE bays SET x_coord = 203, y_coord = 99,width = 18,height = 24, updated_by = ‘ssam@industechnology.com’,updated_date = CURRENT_TIMESTAMP WHERE column_id = 1
old coordinates: 153,243
UPDATE bays SET x_coord = 203, y_coord = 99,width = 18,height = 24, updated_by = ‘ssam@industechnology.com’,updated_date = CURRENT_TIMESTAMP WHERE column_id = 1
old coordinates: 153,261
UPDATE bays SET x_coord = 203, y_coord = 99,width = 18,height = 24, updated_by = ‘ssam@industechnology.com’,updated_date = CURRENT_TIMESTAMP WHERE column_id = 1
old coordinates: 153,279
UPDATE bays SET x_coord = 203, y_coord = 99,width = 18,height = 24, updated_by = ‘ssam@industechnology.com’,updated_date = CURRENT_TIMESTAMP WHERE column_id = 1
old coordinates: 153,297
UPDATE bays SET x_coord = 203, y_coord = 99,width = 18,height = 24, updated_by = ‘ssam@industechnology.com’,updated_date = CURRENT_TIMESTAMP WHERE column_id = 1
since I want to increase the x_coord on all the UPDATE statements by 18, should I just wrap it in a foreach loop?