PhpÓëMysql
PhpÁ¬½ÓmysqlµÄº¯ÊýÈçÏ£º
mysql_connect("Ö÷»úÃû","Óû§Ãû","ÃÜÂë");//´ò¿ªÒ»¸öÁ¬½Ó
mysql_select_db("´ò¿ªÊý¾Ý¿â",Á¬½Ó±êʶ·û);//´ò¿ªÒ»¸öÊý¾Ý¿â
$conn=@mysql_connect("localhost","root","") or die("Á´½Ó´íÎó");ÕâÀï@¿ÉÒÔÒþ²Ø´íÎóÌáʾ,or die¿ÉÒÔÔÚ´íÎóµÄʱºòÏÔʾ¡£
Ö´ÐÐsqlÓï¾äµÄº¯Êý:
mysql_query();
$sql="select * from test";
$result=@mysql_query($sql,$conn) or die(mysql_error());
Á½ÖÖ²éѯº¯Êýmysql_fetch_row()ºÍmysql_fetch_array()µÄÇø±ð£º
Á½ÖÖ¶¼Êǽ«²éѯ½á¹û±£´æµ½Êý×飬µ«ÊÇrow±£´æºóÖ»ÄÜͨ¹ýϱê·ÃÎÊ£¬array»¹¿ÉÒÔͨ¹ýË÷Òý·ÃÎÊ
Ïà¹ØÎĵµ£º
°ÑphpÊý¾Ý»òÖµ´«µÝ¸øjs
£ººÜ¼òµ¥£¬Ö±½ÓÔÚjsÖÐʹÓÃphp´úÂ룬»ì±à¼´¿É¡£
°ÑjsÊý¾Ý´«µÝ¸øphp
£º¿ÉÒÔʹÓôò¿ªÐ´°¿ÚµÄ·½Ê½£¬Í¨¹ýurlµØÖ·°ÑÊý¾Ý´«µÝ¹ýÈ¥¡£Ò²¿ÉÒÔʹÓÃajax£¬Í¨¹ýget»òpost´«µÝ¸øphp£¬Ò²¿ÉÒÔ±£´æcookieÈÃphpÀ´¶Á¡£
ÔÚ´«µÝÊý¾Ý¹ý³ÌÖпÉÄÜÓöµ½ÖÐÎıàÂë
ÎÊÌ⣬¿ÉÒÔͳһ±àÂ뷽ʽΪjsµÄescape£¬unescape£¬Ò²¿ÉÒÔÍ³Ò ......
PHPÊÇһßßЧµÄÍøÂç±à³ÌÓïÑÔ£¬ÓÉÓÚËü¾ßÓбàдÁé»î¡¢ÔËÐпìËÙµÈÓŵ㣬ѸËÙ³ÉΪWeb³ÌÐòÔ±µÄÊ×Ñ¡ÓïÑÔ¡£Ç°²»¾ÃµÄÒ»·ÝȨÍþµ÷²é±íÃ÷£¬ÏÖÔÚÒѾÓÐ31.6£¥µÄÍøվʹÓÃPHP×÷ΪÖ÷ÒªµÄ·þÎñÆ÷¶Ë±à³ÌÓïÑÔ¡£
¡¡¡¡µ«ÊÇ£¬Òª³ÉΪһÃûPHP±à³Ì¸ßÊÖÈ´²¢²»ÈÝÒס£²¢²»ÏñºÜ¶àÈËÏëÏóµÄÄÇÑù£¬Ö»ÒªÄܹ»·É¿ìµØ±àд ......
¼¯³É»·¾³:WAMP...(W-windows,ÀïÃæÓÐApache·þÎñÆ÷¡¢Mysql¡¢PhpºÍMysql¿ÉÊÓ»¯¹¤¾ßSQLite)
Ps:°²×°¹ý³Ì»áÓÐÌáʾ£¬ÊÇ·ñ×ÔÆô¶¯£¬Ä¬ÈÏ¿ª·¢Ä¿Â¼¡¢Ä¬ÈÏä¯ÀÀÆ÷£¬°²×°Íê³Éºó»áÔÚÓÒϽÇÓиöС±íÅÌ£¬ÒòΪĬÈÏ°²×°Íê³ÉºóÊÇÓ¢ÎÄ°æµÄ£¬ÔÚС±íÅÌÉϵãÓÒ¼ü-->language-->Ñ¡ÔñÖÐÎľÍÐÐ)
¿ª·¢¹¤¾ß:easyeclipse php...»¹²»´íµÄÒ»¸ö¿ª·¢¹¤ ......
Ëæ×ÅWeb2.0µÄÉýλ¥ÁªÍøµÄ·¢Õ¹ÓÀ´ÐÂÒ»ÂÖµÄÈȳ±£¬ÓÉÓÚ»¥ÁªÍø±¾ÉíµÄ¿ìËÙ·¢Õ¹¡¢²»¶Ï´´ÐµÄÌص㣬¾ö¶¨ÁËÖ»ÓÐÒÔ×î¿ì¿ª·¢ËٶȺÍ×îµÍ³É±¾£¬²ÅÄÜȡʤ£¬²ÅÄÜʼÖÕ±£³ÖÒ»¸öÍøÕ¾µÄÁìÏÈÐÔºÍÎüÒý¸ü¶àµÄÍøÃñ¡£
»¥ÁªÍøµÄÆóÒµÉú´æºÍ¾ºÕùµÄºËÐÄÔÚÓÚ¼¼Êõ£¬¼¼Êõ/Ñз¢È˲ÅÓÀÔ¶ÊÇÕâЩÆóÒµ²»¿É»òȱµÄ¹Ø¼üÈËÎֻÓÐÓµÓÐ×ÊÉ ......
PHPÊÇÈõÀàÐÍÓïÑÔ¡£
»ù±¾Êý¾ÝÀàÐÍ£ºinteger¡¢string¡¢boolean¡¢float
¸´ºÏÊý¾ÝÀàÐÍ£ºarray¡¢object
»ù±¾Êý¾ÝÀàÐ;Ͳ»ËµÁË£¬ÏÂÃæ¿´Ò»¸öÊý×éÏà¹ØµÄһЩÀý×Ó¡£
$test1=array(1,2,3,4);//¶¨ÒåÁËÒ»¸ö°üº¬4¸öÊýµÄÊý×é
$test1=array("new1"=>1,"new2"=>2);//Á½¸ö±äÁ¿µÄÊý×é,array['new1']=1,array['new2']=2
¶àÎ ......