PHP¶àάÊý×é
/***************************by
garcon1986********************************/
Ò»¸öÈýάÊý×éµÄÏÔʾ£¬±£´æÒÔ±¸ÒÔºóʹÓá£
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<?php
error_reporting(E_ALL ^ E_NOTICE);
$conn = mysql_connect("localhost","charles","charles");
mysql_select_db("crm1204", $conn);
//ΪÁ˸üºÃµÄÏÔʾfor better display
function dump($vars, $label = null, $return = false) {
if (ini_get('html_errors')) {
$content = "<pre>\n";
if ($label !== null && $label !== '') {
$content .= "<b>{$label} :</b>\n";
}
$content .= htmlspecialchars(print_r($vars, true));
$content .= "\n</pre>\n";
}
else {
$content = "\n";
if ($label !== null && $label !== '') {
$content .= $label . " :\n";
}
$content .= print_r($vars, true) . "\n";
}
if ($return) {
return $content;
}
echo $content;
return null;
}
/* ²»ºÃµÄÀý×Ó
$query = "select * from entreprise";
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result)){
$query2 = "select * from site where entreprise_id = $row[entreprise_id]";
$result2 = mysql_query($query2);
$a2 = array();
while($row2 = mysql_fetch_assoc($result2)){
$query3 = "select * from salarie where site_id = $row2[site_id]";
$result3 = mysql_query($query3);
while($row3 = mysql_fetch_assoc($result3)){
$a3[] = array("text"=>$row3[nom]);
}
if($a3[site_id] == $a2[site_id]){
$a2[] = array("text"=>$row2[nom],'children'=>$a3);
}
}
if($a2[entreprise_id] == $a1[entreprise_id]){
$a1[] = array("text"=>$row[id]." ".$row[nom],'children'=>$a2);
}
}
//print_r($a1);
//echo json_encode($a1);
dump($a1);
*/
$entreprise_q = mysql_query("select * from entreprise");
$site_q = mysql_query("select * from site");
$salarie_q = mysql_query(&quo
Ïà¹ØÎĵµ£º
¿´
µ½ÕâÆªÎÄÕÂ
£¬µ±Ê±¾ÍÀá±¼Á˺ü¸»Ø£¬ÖصãÍÆ¼öÏ£¬Ë³±ãÎÒ×Ô¼ºÒ²×ö¸öÕûÀí¡£
sys_getloadavg()
Õâ¸öº¯Êý
·µ»Øµ±Ç°ÏµÍ³µÄ¸ºÔؾùÖµÐÅÏ¢
£¨µ±È» Windows
ϲ»ÊÊÓã©£¬ÏêϸÎĵµ¿ÉÒÔ·ÔÄ PHP µÄÏà¹ØÎĵµ¡£ÎĵµÖÐÓжÎʾÀý´úÂ룬»ù±¾ÉÏÒ²¾ÍÄÜ¿´³öËüµÄÓÃ;ÁË¡£
<?php
$load = sys_getloadavg();
if ($load[0] > 80) ......
½üÀ´ÓÉÓÚ¹¤×÷µÄÐèÒª£¬¿ªÊ¼Ñ§Ï°Ê¹ÓÃPHP¡£
´Ó×òÌìÏÂÎçµ½½ñÌìÉÏÎ磬ÖÕÓÚ°Ñ¿ª·¢»·¾³´î½¨Íê±Ï¡£×ܵÄÀ´Ëµ£º³õ²½µÄÈÏʶÊÇ£ºPHPÔÚÍøÕ¾¿ª·¢ÉÏ£¬¹¦ÄÜ»¹ÊǺÜÇ¿´óµÄ¡£½ñÌìÏÂÎç³õ²½µÄ°ÑÓ﷨ʲôµÄÊìϤһÏ¡£ÒòΪ×ö¿ª·¢Õâô¶àÄêÁË£¬ºÜ¶àÓïÑÔ£¬»¹ÊÇÓеãÏàͬµÄ£¬ËùÒÔ£¬Ñ§Ï°ÆðÀ´²»ÊǺܷѾ¢¡£ºóÌì»ØÀϼң¬Ï£ÍûÄêºóÄÜÔÚPHPÉÏÓÐËùÌá¸ß¡£
Ò»¡¢± ......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>PHP·ÖÒ³</tit ......
/***************************by
garcon1986********************************/
<?php
//php avancé 5 example
$a = 'hello';
$a .= 'world';
$table = 'users';
$id = 5;
$sql = 'SELECT * from'.$table. "WHERE ID = '$id'";
//date() GÏÔʾ24СʱµÄ¸ñʽ£¬iÏÔʾ·ÖÖÓ
echo 'il est'.date( ......