[llvm-commits] CVS: nightlytest-serverside/ProgramResults.php
Jim Laskey
jlaskey at apple.com
Thu Sep 14 09:41:09 PDT 2006
Changes in directory nightlytest-serverside:
ProgramResults.php updated: 1.58 -> 1.59
---
Log message:
Array sql queries are unnecessary
---
Diffs of the changes: (+17 -17)
ProgramResults.php | 34 +++++++++++++++++-----------------
1 files changed, 17 insertions(+), 17 deletions(-)
Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.58 nightlytest-serverside/ProgramResults.php:1.59
--- nightlytest-serverside/ProgramResults.php:1.58 Wed Sep 13 14:21:22 2006
+++ nightlytest-serverside/ProgramResults.php Thu Sep 14 11:40:55 2006
@@ -134,7 +134,7 @@
$result=array();
#print "SELECT * FROM program WHERE night=$night_id ORDER BY program ASC<br>\n";
$program_query = mysql_query("SELECT * FROM program WHERE night=$night_id ORDER BY program ASC") or die (mysql_error());
- while($row = mysql_fetch_array($program_query)){
+ while($row = mysql_fetch_assoc($program_query)){
$program = rtrim($row['program'], ": ");
$result[$program] = array();
array_push($result[$program], "{$row['type']}");
@@ -343,7 +343,7 @@
$night_table_query = mysql_query($night_table_statement ) or die(mysql_error());
$night_arr=array();
$night_query="(";
- while($row = mysql_fetch_array($night_table_query)){
+ while($row = mysql_fetch_assoc($night_table_query)){
$night_arr["{$row['id']}"]=$row['added'];
$results_arr["{$row['added']}"]=array();
preg_match("/(\d\d\d\d)\-(\d\d)\-(\d\d)\s(\d\d)\:(\d\d)\:(\d\d)/", "{$row['added']}", $pjs);
@@ -361,7 +361,7 @@
$program_table_statement="SELECT * FROM program WHERE program=\"$prog\" ".
"and $night_query order by night asc";
$night_table_query=mysql_query($program_table_statement) or die(mysql_error());
- while($row=mysql_fetch_array($night_table_query)){
+ while($row=mysql_fetch_assoc($night_table_query)){
$row['result'] = str_replace("<br>", " ", "{$row['result']}");
$night_id=$row['night'];
$data="-";
@@ -435,7 +435,7 @@
if ($night_id >= 684) {
$query = "SELECT * FROM tests WHERE night=$night_id AND result=\"FAIL\" ORDER BY program ASC";
$program_query = mysql_query($query) or die (mysql_error());
- while($row = mysql_fetch_array($program_query)) {
+ while($row = mysql_fetch_assoc($program_query)) {
$program = rtrim($row['program'], ": ");
$result .= trimTestPath($program) . "\n";
}
@@ -443,7 +443,7 @@
$query = "SELECT * FROM program WHERE night=$night_id ORDER BY program ASC";
$program_query = mysql_query($query) or die (mysql_error());
- while($row = mysql_fetch_array($program_query)) {
+ while($row = mysql_fetch_assoc($program_query)) {
$test_result = $row['result'];
if (!isTestPass($test_result)) {
$program = rtrim($row['program'], ": ");
@@ -467,14 +467,14 @@
if($night_id<684){
$query = "SELECT unexpfail_tests FROM night WHERE id = $night_id";
$program_query = mysql_query($query) or die (mysql_error());
- $row = mysql_fetch_array($program_query);
+ $row = mysql_fetch_assoc($program_query);
$result= $row['unexpfail_tests'];
mysql_free_result($program_query);
}
else{
$query = "SELECT * FROM tests WHERE night=$night_id AND result=\"FAIL\"";
$program_query = mysql_query($query) or die (mysql_error());
- while($row = mysql_fetch_array($program_query)){
+ while($row = mysql_fetch_assoc($program_query)){
$program = rtrim($row['program'], ": ");
$result .= trimTestPath($program) . "\n";
}
@@ -503,7 +503,7 @@
$test_hash = array();
$query = "SELECT * FROM $table WHERE night=$id";
$program_query = mysql_query($query) or die (mysql_error());
- while ($row = mysql_fetch_array($program_query)) {
+ while ($row = mysql_fetch_assoc($program_query)) {
$program = rtrim($row['program'], ": ");
$test_hash[$program] = $row['result'];
}
@@ -521,7 +521,7 @@
$result = "";
$query = "SELECT * FROM $table WHERE night=$id ORDER BY program ASC";
$program_query = mysql_query($query) or die (mysql_error());
- while ($row = mysql_fetch_array($program_query)) {
+ while ($row = mysql_fetch_assoc($program_query)) {
$program = rtrim($row['program'], ": ");
if (!isset($test_hash[$program])) {
$result .= trimTestPath($program) . "\n";
@@ -546,7 +546,7 @@
if($cur_id<684){
$query = "SELECT new_tests FROM night WHERE id = $cur_id";
$program_query = mysql_query($query) or die (mysql_error());
- $row = mysql_fetch_array($program_query);
+ $row = mysql_fetch_assoc($program_query);
$result = $row['new_tests'];
mysql_free_result($program_query);
} else {
@@ -574,7 +574,7 @@
if($cur_id<684){
$query = "SELECT removed_tests FROM night WHERE id = $cur_id";
$program_query = mysql_query($query) or die (mysql_error());
- $row = mysql_fetch_array($program_query);
+ $row = mysql_fetch_assoc($program_query);
$result = $row['removed_tests'];
mysql_free_result($program_query);
} else {
@@ -607,7 +607,7 @@
$test_hash = array();
$query = "SELECT * FROM $table WHERE night=$id";
$program_query = mysql_query($query) or die (mysql_error());
- while ($row = mysql_fetch_array($program_query)) {
+ while ($row = mysql_fetch_assoc($program_query)) {
if (!isTestPass($row['result'])) {
$program = rtrim($row['program'], ": ");
$test_hash[$program] = $row['result'];
@@ -627,7 +627,7 @@
$result = "";
$query = "SELECT * FROM $table WHERE night=$id ORDER BY program ASC";
$program_query = mysql_query($query) or die (mysql_error());
- while ($row = mysql_fetch_array($program_query)) {
+ while ($row = mysql_fetch_assoc($program_query)) {
$program = rtrim($row['program'], ": ");
$wasfailing = isset($test_hash[$program]);
$ispassing = isTestPass($row['result']);
@@ -655,7 +655,7 @@
if($cur_id<684){
$query = "SELECT newly_passing_tests FROM night WHERE id = $cur_id";
$program_query = mysql_query($query) or die (mysql_error());
- $row = mysql_fetch_array($program_query);
+ $row = mysql_fetch_assoc($program_query);
$result = $row['newly_passing_tests'];
mysql_free_result($program_query);
} else {
@@ -683,7 +683,7 @@
if($cur_id<684){
$query = "SELECT newly_failing_tests FROM night WHERE id = $cur_id";
$program_query = mysql_query($query) or die (mysql_error());
- $row = mysql_fetch_array($program_query);
+ $row = mysql_fetch_assoc($program_query);
$result = $row['newly_failing_tests'];
mysql_free_result($program_query);
} else {
@@ -705,14 +705,14 @@
function getPreviousWorkingNight($night_id ){
$query = "SELECT machine FROM night WHERE id=$night_id";
$program_query = mysql_query($query) or die (mysql_error());
- $row = mysql_fetch_array($program_query);
+ $row = mysql_fetch_assoc($program_query);
$this_machine_id=$row['machine'];
mysql_free_result($program_query);
$query = "SELECT id FROM night WHERE machine=$this_machine_id ".
"and id<$night_id and buildstatus=\"OK\" order by added desc";
$program_query = mysql_query($query) or die (mysql_error());
- $row = mysql_fetch_array($program_query);
+ $row = mysql_fetch_assoc($program_query);
$prev_id=$row['id'];
mysql_free_result($program_query);
More information about the llvm-commits
mailing list