Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

php¶ÁÊý¾Ý¿âÂÒÂë

<?php
// Á¬½Ó£¬Ñ¡ÔñÊý¾Ý¿â
$dbconn = pg_connect("host=localhost dbname=publishing user=www password=foo")
    or die('Could not connect: ' . pg_last_error());
// Ö´ÐÐ SQL ²éѯ
$query = 'SELECT * from authors';
$result = pg_query($query) or die('Query failed: ' . pg_last_error());
// Óà HTML ÏÔʾ½á¹û
echo "<table>\n";
while ($line = pg_fetch_array($result, null, PGSQL_ASSOC)) {
    echo "\t<tr>\n";
    foreach ($line as $col_value) {
        echo "\t\t<td>$col_value</td>\n";
    }
    echo "\t</tr>\n";
}
echo "</table>\n";
// ÊͷŽá¹û¼¯
pg_free_result($result);
// ¹Ø±ÕÁ¬½Ó
pg_close($dbconn);
?>
http://php.chinaunix.net/manual/zh/ref.pgsql.php
ps:Ò³ÃæÉêÃ÷±àÂ룺ÔÚHTML´úÂëHEADÀïÃ棬¿ÉÒÔÓÃ<meta http-equiv="Content-Type" content="text/html;
charset="XXX" />À´¸æËßä¯ÀÀÆ÷ÍøÒ³²ÉÓÃÁËʲô±àÂ룬ĿǰÖÐÎÄÍøÕ¾¿ª·¢ÖÐÖ÷ÒªÓõÄÊÇGB2312ºÍUTF-8Á½ÖÖ±à
Âë¡£
ÌáÈ¡µÄÊý¾Ý±àÂëÓë "<META http-equiv=Content-Type content="text/html; charset=gb2312">" ÍøÒ³Ò³Ãæ
±àÂëÒ»ÖÂ,ÕâÑùÍøÒ³ÖоÍûÓÐÂÒÂëÁË¡£
$db->query("set client_encoding to 'gbk'");
Èç¹û²»Ïë¸ÄÅäÖÃÎļþ
ÔÚÒ³Ãæ´úÂëÖмÓÈëЧ¹ûÒ»Ñù!
Ô­À´ÊÇÕâÑù£¬¿ÉÒÔÉèÖÿͻ§¶Ë±àÂëµÄ£¬ÎÒÒ»Ö±¸øÊý¾Ý¿â¶¨ÒåΪ
[code]
CREATE DATABASE hent
  WITH OWNER = postgres
       ENCODING = 'EUC_CN'
       TABLESPACE = pg_default;
[/code]
¸ÄÈý¸öÅäÖÃÎļþ¼´¿É.Æäʵ´ó¼Ò¶¼ÖªµÀÊÇÄÄÈý¸öÁË.
php.ini           my.cnf           httpd.conf  ¾ÍºÃÁË.°Ñ±àÂëÓйصĶ¼ÉèÖÃ³É utf-8¼´¿É.
µ«ÊÇ»¹²»ÐÐ.ÒòΪÎÒ°²×°ÁË. php-mbstring .ËùÒÔÔÚphp.iniÀïÃæÒ»¶¨Òª¿ªÆô mbstring ÇÒ±àÂëÒ²ÒªÉèÖóÉ
utf-8.
php.ini ;default_charset = "iso-8859-1"   ¸Ä³É default_charset = "UTF-8"
<?
header('content-Type=text/html;charset=utf-8')
php
echo "t


Ïà¹ØÎĵµ£º

ubuntu Ï ´î½¨ apache+php+mysql


#apt-get install apache2
//°²×°apahce2
#apt-get install php5
//°²×°php5
#apt-get install mysql-server
//°²×°mysql·þÎñ¶Ë
#apt-get install  mysql-myclient
//°²×°mysqlµÄ¿Í»§¶Ë
#apt-get install php-mysql
//°²×°php-mysqlµÄÁ¬½á
apache+php+mysql »·¾³ÒѾ­´î½¨ºÃÁË
½«ÒÔϵķþÎñÖØÆôÒ»ÏÂ
#/et ......

PHP»º´æ¼¼ÊõÏê̸

Ò»¡¢ÒýÂÛ
PHP,Ò»ÃÅ×î½ü¼¸ÄêÐËÆðµÄwebÉè¼Æ½Å±¾ÓïÑÔ,ÓÉÓÚËüµÄÇ¿´óºÍ¿ÉÉìËõÐÔ,½ü¼¸ÄêÀ´µÃµ½³¤×ãµÄ·¢Õ¹,phpÏà±È´«Í³µÄaspÍøÕ¾,ÔÚËÙ¶ÈÉÏÓоø¶ÔµÄÓÅÊÆ,Ïëmssqlת6ÍòÌõÊý¾ÝphpÈçÐèÒª40Ãë,asp²»ÏÂ2·ÖÖÓ.µ«ÊÇ,ÓÉÓÚÍøÕ¾µÄÊý¾ÝÔ½À´Ô½¶à,ÎÒÃÇ¿ÊÇóÄܸü¿ìËٵĵ÷ÓÃÊý¾Ý,²»±ØҪÿ´Î¶¼´ÓÊý¾Ý¿âµô,ÎÒÃÇ¿ÉÒÔ´ÓÆäËûµÄµØ·½,±È·½Ò»¸öÎļþ,»òÕßij¸ ......

PHP½ØÈ¡¹Ì¶¨³¤¶È×Ö·û´®º¯Êý

<?php   
  
function toFixLen($str,$len){ //¹Ì¶¨³¤¶È×Ö·û´®µÄ½ØÈ¡   
  
    if($len>=strlen($str)||!$len) return $str;   
  
    $len-=3;   
  
  ......

20¸ö·Ç³£ÓÐÓõÄPHPÀà¿â

ÏÂÃæÊÇһЩ·Ç³£ÓÐÓõÄphpÀà¿â£¬ÏàÐÅÒ»¶¨¿ÉÒÔΪÄãµÄWEB¿ª·¢Ìṩ¸üºÃºÍ¸üΪ¿ìËٵķ½·¨¡£
¡¡¡¡Í¼±í¿â
¡¡¡¡ÏÂÃæµÄÀà¿â¿ÉÒÔÈÃÄãºÜ¼òµÄ´´½¨¸´ÔÓµÄͼ±íºÍͼƬ¡£µ±È»£¬ËüÃÇÐèÒªGD¿âµÄÖ§³Ö¡£
¡¡¡¡PChart - Ò»¸ö¿ÉÒÔ´´½¨Í³¼ÆͼµÄ¿â¡£
¡¡¡¡Libchart - ÕâÒ²ÊÇÒ»¸ö¼òµ¥µÄͳ¼Æͼ¿â¡£
¡¡¡¡JpGraph - Ò»¸öÃæÏò¶ÔÏóµÄͼƬ´´½¨Àà¡£
¡¡¡¡ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ