$cacheDir, "automaticSerialization" => "TRUE", "hashedDirectoryLevel" => 1, "lifeTime" =>$lifeTime ); $queryAll_cache = new Cache_Lite($option); //Cache if ($get_data = $queryAll_cache->get($param)) { //print"queryAll_cache"; //if($_SERVER['REMOTE_ADDR']=='61.205.232.128' OR $_SERVER['REMOTE_ADDR']=='61.45.36.73'){print"cache queryAll_cache $sql\n";} return $get_data; }else{ //$sql = str_replace('SELECT', 'SELECT HIGH_PRIORITY', $sql); //$sql = str_replace('select', 'SELECT HIGH_PRIORITY', $sql); global $mysqldb_ip; global $mysqldb_user; global $mysqldb_ps; if(!$setnames){$setnames="eucjpms";} $db=mysql_connect("$mysqldb_ip","$mysqldb_user","$mysqldb_ps"); if (!$db) {die('connect error' . mysql_error());} $db=mysql_select_db("$database",$db); if (!$db) {die('DB error' . mysql_error());} $db=mysql_query("SET NAMES $setnames"); if (!$db) {die('SET NAMES error' . mysql_error());} $result = mysql_query("$sql");if (!$result) {die("SQL error $sql" . mysql_error());} if (mysql_num_rows($result) == 0) {$get_data='0';return $get_data;}else{$rows = mysql_num_rows($result);} if($type=='ALL'){ //配列返す while ($row = mysql_fetch_assoc($result)) {$get_data['DB'][]=$row;} $get_data['MAX']=$rows; }elseif($type=='NUM'){ //件数返す $get_data=$rows; }elseif($type=='ROW'){ //1件返す $get_data = mysql_fetch_assoc($result); }else{ while ($row = mysql_fetch_assoc($result)) { $key=$row[$type]; $get_data[$key][]=$row; } } mysql_free_result($result); mysql_close(); $queryAll_cache->save($get_data,$param); return $get_data; } } /********************************************************************************************************* インサート *********************************************************************************************************/ function mysql_Insert($data,$table_name,$fields_values) { //接続 global $mysqldb_ip; global $mysqldb_user; global $mysqldb_ps; extract($data); $db=mysql_pconnect("$mysqldb_ip","$mysqldb_user","$mysqldb_ps");if (!$db) {die('connect error' . mysql_error());} $db=mysql_select_db("$db_name",$db); if (!$db) {die('DB error' . mysql_error());} // $db=mysql_query("SET NAMES eucjpms"); if (!$db) {die('SET NAMES error' . mysql_error());} // $db=mysql_query("SET NAMES ujis"); if (!$db) {die('SET NAMES error' . mysql_error());} // $db=mysql_query("SET NAMES sjis"); if (!$db) {die('SET NAMES error' . mysql_error());} $db=mysql_query("SET NAMES utf8"); if (!$db) {die('SET NAMES error' . mysql_error());} if($fields_values){ foreach ($fields_values AS $key => $val) { if(is_array($val)){print_r($val);}else{ if(isset($clm)){$clm .=",`$key`";}else{$clm ="`$key`";} //$val=mysql_real_escape_string($val); $val=str_replace("\\","",$val); $val=str_replace("\\\\","",$val); $val=mysql_escape_string($val); if(isset($clm_val)){$clm_val .=",'$val'";}else{$clm_val ="'$val'";} } } } $sql = <<< EOF INSERT INTO $table_name ($clm)VALUES($clm_val) EOF; //print"$sql"; $db=mysql_query("$sql"); if (!$db) { print("DB:insert"); print("DB:$data[db_name]
"); print("TB:$table_name
"); print("SQL:$sql
"); print(mysql_error()); } unset($fields_values); //mysql_free_result($result); //mysql_close(); return ; } /********************************************************************************************************* 更新 *********************************************************************************************************/ function mysql_Update($data,$table_name,$fields_values,$cond) { //接続 global $mysqldb_ip; global $mysqldb_user; global $mysqldb_ps; $db=mysql_pconnect("$mysqldb_ip","$mysqldb_user","$mysqldb_ps"); if (!$db) {die('connect error' . mysql_error());} $db=mysql_select_db("$data[db_name]",$db); if (!$db) {die('DB error' . mysql_error());} // $db=mysql_query("SET NAMES sjis"); if (!$db) {die('SET NAMES error' . mysql_error());} // $db=mysql_query("SET NAMES ujis"); if (!$db) {die('SET NAMES error' . mysql_error());} $db=mysql_query("SET NAMES utf8"); if (!$db) {die('SET NAMES error' . mysql_error());} //{rval cond} $i=0; foreach ($cond AS $key => $val) {if($i=='0'){$WHERE="($key='$val')";}else{$WHERE .="AND($key='$val')";}$i++;} if($fields_values){ foreach ($fields_values AS $key => $val) { //$val=mysql_real_escape_string($val); $val=str_replace("\\","",$val); $val=str_replace("\\\\","",$val); $val=mysql_escape_string($val); if(isset($clm_val)){$clm_val .=",`$key`='$val'";}else{$clm_val ="`$key`='$val'";} } } //print"data"; $sql = "UPDATE `$table_name` SET $clm_val WHERE $WHERE"; $db=mysql_query("$sql"); if (!$db) { print("DB:Update"); print("DB:$data[db_name]
"); print("TB:$table_name
"); print("SQL:$sql
"); print(mysql_error()); } $query_id = mysql_query("SELECT oid FROM $table_name WHERE $WHERE"); $num = mysql_num_rows($query_id); unset($fields_values); //mysql_close(); return $num; } /********************************************************************************************************* 削除 *********************************************************************************************************/ function mysql_Delete($data,$table_name,$cond) { //接続 global $mysqldb_ip; global $mysqldb_user; global $mysqldb_ps; // $db=mysql_pconnect("$mysqldb_up","$mysqldb_user","$mysqldb_ps");if (!$db) {die('connect error' . mysql_error());} $db=mysql_pconnect("$mysqldb_ip","$mysqldb_user","$mysqldb_ps");if (!$db) {die('connect error' . mysql_error());} //$db=mysql_pconnect("$mysqldb_ip","$mysqldb_user","$mysqldb_ps"); if (!$db) {die('connect error' . mysql_error());} $db=mysql_select_db("$data[db_name]",$db); if (!$db) {die('DB error' . mysql_error());} // $db=mysql_query("SET NAMES eucjpms"); if (!$db) {die('SET NAMES error' . mysql_error());} $db=mysql_query("SET NAMES utf8"); if (!$db) {die('SET NAMES error' . mysql_error());} //{rval cond} $i=0; foreach ($cond AS $key => $val) {if($i=='0'){$WHERE="($key='$val')";}else{$WHERE .="AND($key='$val')";}$i++;} /* if(!empty($data["shikibetsu"])){ if($data["shikibetsu"]=="<"){ $i=0; foreach ($cond AS $key =< $val) {if($i=='0'){$WHERE="($key<'$val')";}else{$WHERE .="AND($key<'$val')";}$i++;} } } */ /* if($fields_values){ foreach ($fields_values AS $key => $val) { $val=mysql_real_escape_string($val); if(isset($clm_val)){$clm_val .=",`$key`='$val'";}else{$clm_val ="`$key`='$val'";} } } */ $sql = "DELETE FROM `$table_name` WHERE $WHERE"; $db=mysql_query("$sql"); if (!$db) { print("DB:Delete"); print("DB:$data[db_name]
"); print("TB:$table_name
"); print("SQL:$sql
"); print(mysql_error()); } $query_id = mysql_query("SELECT oid FROM $table_name WHERE $WHERE"); $num = mysql_num_rows($query_id); // unset($fields_values); //mysql_close(); return $num; } /********************************************************************************************************* 削除(複数条件) *********************************************************************************************************/ function mysql_Delete_sec($data,$table_name,$cond1,$cond2,$cond3) {//$cond1 = / $cond2 < / $cond3 > //接続 global $mysqldb_ip; global $mysqldb_user; global $mysqldb_ps; $db=mysql_pconnect("$mysqldb_ip","$mysqldb_user","$mysqldb_ps");if (!$db) {die('connect error' . mysql_error());} $db=mysql_select_db("$data[db_name]",$db); if (!$db) {die('DB error' . mysql_error());} // $db=mysql_query("SET NAMES eucjpms"); if (!$db) {die('SET NAMES error' . mysql_error());} $db=mysql_query("SET NAMES utf8"); if (!$db) {die('SET NAMES error' . mysql_error());} if($cond1 != 0){ $i=0; foreach ($cond1 AS $key => $val) {if($i=='0'){$WHERE="($key='$val')";}else{$WHERE .="AND($key='$val')";}$i++;} }else{ $WHERE=""; } if($cond2 != 0){ $i=0; foreach ($cond2 AS $key => $val) { if($WHERE == ""){ $WHERE .="($key<'$val')"; }else{ $WHERE .="AND($key<'$val')"; } $i++; } }else{ } if($cond3 != 0){ $i=0; foreach ($cond3 AS $key => $val) { if($WHERE == ""){ $WHERE .="($key>'$val')"; }else{ $WHERE .="AND($key>'$val')"; } $i++; } }else{ } $sql = "DELETE FROM `$table_name` WHERE $WHERE";//print"$sql"; $db=mysql_query("$sql"); if (!$db) { print("DB:Delete"); print("DB:$data[db_name]
"); print("TB:$table_name
"); print("SQL:$sql
"); print(mysql_error()); } /* $db=mysql_connect("$mysqldb_ip","$mysqldb_user","$mysqldb_ps"); if (!$db) {die('connect error' . mysql_error());} $num = mysql_affected_rows($db); */ $query_id = mysql_query("SELECT oid FROM $table_name WHERE $WHERE"); $num = mysql_num_rows($query_id); return $num; } } ?>
Fatal error: 'break' not in the 'loop' or 'switch' context in /home/users/2/literacy00/web/grandmeal_manage/class/resizeimg.class.php on line 72