php¶¯Ì¬Éú³É±í¸ñµÄºÏ²¢
<?php
$link=mysql_connect("localhost","root","root");
$db=mysql_select_db("bustest",$link);
$sql1="select name from info group by name order by id asc";
print("<table border='1'>");
$res1=mysql_query($sql1);
while($row1=mysql_fetch_array($res1)){
$name=$row1["name"];
$sql2="select id from info where name ='$name' order by id asc";
$res2=mysql_query($sql2);
while($row2=mysql_fetch_array($res2)){
print("<tr>");
$id=$row2["id"];
print("<td>$id</td>");
$sql3="select count(*),id from info where name ='$name' group by name order by id asc";
$res3=mysql_query($sql3);
while($row3=mysql_fetch_array($res3)){
$id1=$row3["id"];
if($id1==$id){
$num=$row3[0];
print("<td rowspan='$num' >");
print $name;
print("</td>");
}else{
print("</tr>");
}
}
}
print("</tr>");
}
print("</table>");
mysql_close($link);
?>
Ïà¹ØÎĵµ£º
Session¼ò½é
session ·Ö³ÉÁ½²¿·Ö£¬session¿Õ¼ä´æ·ÅÓÚ·þÎñÆ÷¶Ë£¬´ò¿ª¿Õ¼äµÄID ´æ·ÅÓÚ ¿Í»§¶ËµÄcookie£¬ Èç¹û¿Í»§¶Ë¹Ø±ÕÁËcookie£¬session¾Í²»ÄÜÕý³£µÄʹÓá£
SessionµÄÖÐÎÄÒëÃû½Ð×ö“»á»°”£¬Æä±¾À´µÄº¬ÒåÊÇÖ¸ÓÐʼÓÐÖÕµÄһϵÁж¯×÷/ÏûÏ¢£¬±ÈÈç´òµç»°Ê±´ÓÄÃÆðµç»°²¦ºÅµ½¹Ò¶Ïµç»°ÕâÖмäµÄһϵÁйý³Ì¿ÉÒÔ³Æ ......
×öPHP³ÌÐòµÄÈ˶¼ÖªµÀhtmlentitiesºÍhtmlspecialcharsº¯Êý£¬¶¼ÊǸñʽ»¯html´úÂëµÄ£¬µ«ÊÇÕâ¶þ¸öº¯ÊýÊÇ·ñÕæµÄ¹¦ÄÜÒ»ÑùÂ𣿠php³ÌÐòÔ±Ö®¼Ò ÕâÁ½¸öº¯ÊýÔÚ¸ñʽ»¯´øÓÐÓ¢ÎÄ×Ö·ûµÄhtml´úÂëµÄʱºò»ù±¾Ã»É¶ÎÊÌ⣬µ«ÊÇhtmlentities¶ÔÖÐÎÄ×Ö·ûÒ²²»·Å¹ý£¬ÕâÑùµÃ³öÀ´µÄ½á¹ûÊÇÖÐÎÄ×Ö·û²¿·Ö±äΪһ¶ÑÂÒÂë¡£µ±Ê±×öÓ¢ÎÄÕ¾µÄʱºò¸ù±¾¾Íû¾õ²ìµ ......
ʹÓÃphpµÄ³£¼ûÎÊÌâÊÇ£º±àÒëphpʱÍü¼ÇÌí¼ÓijÀ©Õ¹£¬ºóÀ´ÏëÌí¼ÓÀ©Õ¹£¬µ«ÊÇÒòΪ°²×°phpºóÓÖ×°ÁËһЩ¶«Î÷ÈçPEARµÈ£¬²»Ïëɾ³ýĿ¼ÖØ×°£¬±ð˵£¬php»¹ÕæÓÐÕâÑùµÄ¹¦ÄÜ¡£
¡¡¡¡ÎÒûÓÐÔÚÊÖ²áÖп´µ½¡£
¡¡¡¡ÈçÎÒÏëÔö¼ÓbcmathÖ§³Ö£¬ÕâÊÇÒ»¸öÖ§³Ö´óÕûÊý¼ÆËãµÄÀ©Õ¹¡£windows×Ô´ø¶øÇÒÄÚÖã¬linux“±¾ÀຯÊý½öÔÚ PHP ±àÒëʱÅäÖÃÁË --ena ......
PHP ÖÐÇÉÓÃÊý×é½µµÍ³ÌÐòµÄʱ¼ä¸´ÔÓ¶È
Íõ µ¤µ¤, ¸ß¼¶Èí¼þ¹¤³Ìʦ, IBM
2009 Äê 11 ÔÂ 26 ÈÕ
±¾ÎÄÖ÷ÒªÊǽéÉÜÔÚ PHP µÄ±à³ÌÖУ¬ÈçºÎÇÉÓÃÊý×éÀ´½µµÍÒò¶à²ãÑ»·¶øÒýÆðµÄʱ¼ä¸´ÔӶȵÄÎÊÌâ¡£ÌرðÊǵ±³ÌÐòÐèÒª¶à´ÎÓëÊý¾Ý¿â½»»¥Ê±£¬Óô˷½·¨À´ÓÅ»¯ÄãµÄ´úÂ룬½«»á´ø¸øÒâÏë²»µ½µÄЧ¹û¡£
ͨ³£¿ª·¢ÈËÔ±ÔÚд³ÌÐòµÄʱºò£¬ÍùÍùÊÇ°ÑÒѾÉè ......