$result = geResult($sql, $link); $pick = memory_get_peak_usage($real); $benchmark->stop($pick, 'UPDATE '); $sql = "SELECT \n employeeNumber, lastName, firstName\nFROM\n employees\nWHERE\n firstname LIKE 'T_m';"; $memory = memory_get_usage($real); $benchmark->start($memory); $result = geResult($sql, $link); $pick = memory_get_peak_usage($real); $benchmark->stop($pick, 'LIKE '); //$sqlMax = "SELECT max(officeCode) FROM offices"; //$result = mysql_result($sqlMax, $link); //$array = mysql_fetch_array($result); //$maxOfficeCode = $array[0]; // // // //$OfficeCode = $maxOfficeCode + 1; $sql = "INSERT INTO offices(officeCode, city, phone, addressLine1, country, postalCode, territory)\nVALUES('{$OfficeCode}', 'Paris', '0123456789', 'address ligne 1', 'FRANCE', '75012', 'FR');"; $memory = memory_get_usage($real); $benchmark->start($memory); $result = geResult($sql, $link, 'insert'); $pick = memory_get_peak_usage($real); $benchmark->stop($pick, 'INSERT '); $sql = "DELETE \n offices \nFROM \n offices \nWHERE offices.officeCode = "; $memory = memory_get_usage($real); $benchmark->start($memory); $result = geResult($sql, $link, 'delete'); $pick = memory_get_peak_usage($real); $benchmark->stop($pick, 'DELETE '); $totalMemoryEnd = memory_get_usage($real); echo $totalMemoryEnd - $totalMemory;
$memory = memory_get_usage($real); $benchmark->start($memory); $result = geResult($sql, $dbh); $pick = memory_get_peak_usage($real); $benchmark->stop($pick, 'UPDATE '); $sql = "SELECT \n employeeNumber, lastName, firstName\nFROM\n employees\nWHERE\n firstname LIKE 'T_m';"; $memory = memory_get_usage($real); $benchmark->start($memory); $sth = $dbh->prepare($sql); $sth->execute(array($res)); $pick = memory_get_peak_usage($real); $benchmark->stop($pick, 'LIKE '); $sth = $dbh->prepare($sql); $sth->execute(); $res = $sth->fetch(PDO::FETCH_NUM); $maxOfficeCode = $res[0]; $OfficeCode = $maxOfficeCode + 1; $sql = "INSERT INTO offices(officeCode, city, phone, addressLine1, country, postalCode, territory)\nVALUES('{$OfficeCode}', 'Paris', '0123456789', 'address ligne 1', 'FRANCE', '75012', 'FR');"; $memory = memory_get_usage($real); $benchmark->start($memory); $result = geResult($sql, $dbh); $pick = memory_get_peak_usage($real); $benchmark->stop($pick, 'INSERT '); $sql = "DELETE \n offices \nFROM \n offices \nWHERE offices.officeCode = ?"; $memory = memory_get_usage($real); $benchmark->start($memory); $result = geResult($sql, $dbh, true); $pick = memory_get_peak_usage($real); $benchmark->stop($pick, 'DELETE '); $totalMemoryEnd = memory_get_usage($real); echo $totalMemoryEnd - $totalMemory;