PHP»ñÈ¡radioÖµ£¬²¢ÓÃ×÷²ÎÊý²éѯÊý¾Ý¿â£¬Í¬Ò»Ò³ÃæÏÔʾ
/***************************by garcon1986************************************/
<?php
error_reporting(E_ALL ^ E_NOTICE);
//create database test
//create table php_radio(id int(10) NOT NULL AUTO_INCREMENT, name varchar(100), description varchar(1000), primary key(id));
//insert php_radio values(1, 'eat','you have eaten ...');
//insert php_radio values(2, 'drink', 'you have drank ...');
//insert php_radio values(3, 'sleep', 'you have sleep ...');
echo "<html><head></head>";
echo "<body>";
echo "<form action='use_radio.php' method='GET'>";
echo "<input type='radio' name='radio' value='eat'>Eat</input>";
echo "<input type='radio' name='radio' value='drink'>Drink</input>";
echo "<input type='radio' name='radio' value='sleep'>Sleep</input>";
echo "<input type='submit' name='search_radio' value='Button' />";
echo "</form>";
$radio_name = $_GET['radio'];
//echo $radio_name;
mysql_connect("localhost","charles","charles");
mysql_select_db("test");
$query = 'select * from php_radio where name = "'.$radio_name.'"';
//echo $query;
$result = mysql_query($query) or die("query error: ".mysql_error());
while($aa = mysql_fetch_assoc($result)){
echo $aa['id']." ";
echo $aa['name']." ";
echo $aa['description']."<br>";
}
//mysql_free_result($result);
echo "</body>";
echo "</html>"
?>
Ïà¹ØÎĵµ£º
ÔÎÄÁ´½Ó£ºhttp://www.phpdo.net/index.php/2010/02/11/1-14/
PHPÖлñµÃÈÕÆÚʱ¼äÐÅÏ¢µÄº¯Êý——Getdate
ʱ¼ä´Á:°üº¬ÁË´ÓunixмÍÔª£¨1970Äê1ÔÂ1 ÈÕÁãʱ£©µ½¸ø¶¨Ê±¼äµÄÃëÊý£¬ÊÇÒ»¸ö³¤ÕûÊý¡£
Getdateº¯Êý¾ÍÊÇÓÃÀ´»ñµÃµ±Ç°Ê±¼ä£¬»òÕßÓÃÀ´·ÖÎöʱ¼ä´ÁµÄ¾ßÌåÒâÒå¡£Óï·¨£º
Array getdate([int timestamp])
º¬Ò壺ti ......
½üÀ´ÓÉÓÚ¹¤×÷µÄÐèÒª£¬¿ªÊ¼Ñ§Ï°Ê¹ÓÃPHP¡£
´Ó×òÌìÏÂÎçµ½½ñÌìÉÏÎ磬ÖÕÓÚ°Ñ¿ª·¢»·¾³´î½¨Íê±Ï¡£×ܵÄÀ´Ëµ£º³õ²½µÄÈÏʶÊÇ£ºPHPÔÚÍøÕ¾¿ª·¢ÉÏ£¬¹¦ÄÜ»¹ÊǺÜÇ¿´óµÄ¡£½ñÌìÏÂÎç³õ²½µÄ°ÑÓ﷨ʲôµÄÊìϤһÏ¡£ÒòΪ×ö¿ª·¢Õâô¶àÄêÁË£¬ºÜ¶àÓïÑÔ£¬»¹ÊÇÓеãÏàͬµÄ£¬ËùÒÔ£¬Ñ§Ï°ÆðÀ´²»ÊǺܷѾ¢¡£ºóÌì»ØÀϼң¬Ï£ÍûÄêºóÄÜÔÚPHPÉÏÓÐËùÌá¸ß¡£
Ò»¡¢± ......
PHPµÄÖ´ÐÐЧÂÊÊÇÓÐÄ¿¹²¶ÃµÄ£¬ÕâÒ²ÊÇÎÒϲ»¶ËüµÄÔÒòÖ®Ò»£¬ºÍËü³ÆÎª¾øÃî´îµµµÄMysqlÒÔ¼°ApacheÏëÈںϣ¬²»Äܲ»¾ªÌ¾ÆäЧÂÊÁË¡£PHP¸üÐÂÒ²ºÜ¿ì£¬ÕâÀïÁоÙÁËĿǰ×îа汾PHP4.3.2RC4£¨¼¸ºõûÓÐBUGÁË£¬¹À¼ÆÐ´ÍêÕâÆª²»¾ÃºóÕýʽ°æ¾Í³öÁË£©£¬ºÍ×îа汾µÄMysql4.0.13µÄ°²×°¹ý³Ì¡£
¡¡¡¡PHPµÄ°²×°Îļþ¿ÉÒÔÖ±½Óµ½ &nb ......
/***************************by
garcon1986********************************/
<?php
// simple assgin the values
$arr1 = array(12 => 10, 'sjg' => 'yaya');
echo $arr1[12].'<br>'; // 10
echo $arr1['sjg']."<br>"; //yaya
echo "wo ai ni !<p> ......
/*********************************************************************************************
*****************************php¶þ¼¶Áª¶¯²Ëµ¥¸Ä¶¯°æ***********************************
****************************************by garcon1986*****************************************
********************* ......