phpÄ£°å¼¼Êõ
Õ¾µã½á¹¹
´úÂë:
Õ¾µã
©»includes
©»class.inc
©Çtemplet
©»index.htm
©Çlist.htm
©»content.htm
©Çindex.php
©»content.php
¿â½á¹¹
´úÂë:
-- Êý¾Ý¿â: `test`
-- ±íµÄ½á¹¹ `test`
CREATE TABLE `test` (
`id` smallint(3) NOT NULL auto_increment,
`name` varchar(10) NOT NULL default '',
`sex` enum('ÄÐ','Å®') NOT NULL default 'ÄÐ',
`age` smallint(2) NOT NULL default '0',
`email` varchar(20) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;
--------------- class.incÎļþ --------
CODE:
<?
php
class
mycon
{
private
$myhost
;
private
$myuser
;
private
$mypwd
;
function
mycon
(
$host
=
"localhost"
,
$user
=
"root"
,
$pwd
=
""
){
$this
->
myhost
=
$host
;
$this
->
myuser
=
$user
;
$this
->
mypwd
=
$pwd
;
}
function
connect
(){
return
mysql_connect
(
$this
->
myhost
,
$this
->
myuser
,
$this
->
mypwd
);
}
}
class
templet
{
private
$source_file
;
function
get_file
(
$filename
){
$
Ïà¹ØÎĵµ£º
×î½ü×öÁ˼¸¸öСÐ͵ÄÏîÄ¿£¬±È½Ï¼òµ¥£¬Ö»ÊÇÐèҪϸÐÄ£¬¶¼¿ÉÒÔÍê³É£¬Ö÷ÒªÊǶÔMVCģʽµÄÊìÁ·Ó¦Ó㬶ÔWEBÀ࿪·¢»¹ÊǺÜÓаïÖúµÄ¡£
¸Õ¿ªÊ¼µÄµÚÒ»¸öСÏîÄ¿£¬ÓÃÀ´Á·ÊÖ£¬È»ºóÎÒÈ«²¿ÊÇÁ÷³Ì»¯µÄ±à³Ì¡£´úÂëÒ²¾Í400ÐÐ×óÓÒ¡£½á¹ûÎҵĵ¼Ê¦£¬¾õµÃ´úÂë½á¹¹²»ÇåÎú£¬²»ÈÝÒ×
ά»¤£¬ÐèÒªÐ޸ġ£ÐèÒªÎÒ²ÉÓÃOOÀàµÄ±à³Ì·½Ê½½øÐиÄд¡£ÎÒÒÔǰдPHP£¬¼¸ ......
ÎÒÔÚmy.cnfÖÐ×¢Ê͵ôlog-bin=mysql-binºÍbinlog_format=mixedºó,ÎÞ·¨Æô¶¯mysql
ÎÒÖØÆôvpsºó,ÄÜÆô¶¯mysqlÀ²
ÓÃweb·½Ê½ÔËÐÐphp,Õý³£
µ«ÊÇÔÚcrontabÀïÖ´ÐеÄphp½Å±¾,Ìáʾ: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) ²é¿´µ½/var/lib/mysql/Ŀ¼ÏÂ,ÓÐÒ»¸ömysql.s ......
1¡¢mysql_connect()-½¨Á¢Êý¾Ý¿âÁ¬½Ó
¸ñʽ£º
resource mysql_connect([string hostname [:port] [:/path/to/socket] [, string username] [, string password]])
Àý£º
$conn = @mysql_connect(”localhost”, “username”, “password”) or dir(”²»ÄÜÁ¬½Óµ½Mysql Server” ......
wangjimima.php
<form id="form1" name="form1" method="post" action="mailto.php" onSubmit="return CheckForm()">
<input name="username" type="text" class="in" id="username" size="30" onmouseover="fEvent('mouseover',this)" onfocus="fEvent('focus',this)" onblur="fEvent('blur',this)" onmouseout ......
×î½üÒ»Ö±ÔÚÑо¿freeBSDÏÂnginx+php+mysqlµÄ°²×°£¬¿´Á˺ܶàÍøÉϵÄ×ÊÁÏÊÕ»ñ²»Ð¡£¬²»¹ý´ó²¿·Ö¶¼ÊDZàÒë°²×°£¬Ïà¶Ô³õѧÕßÀ´Ëµ±È½Ï¸´ÔÓ£¬²»ÈÝÒ×Àí½â£¬ËùÒÔÎÒÕûºÏÁËһЩports°²×°µÄ×ÊÁÏ£¬¶¼ÊǾ¹ý×Ô¼ºÑéÖ¤ºóµÄ£¬°²×°³É¹¦Ò²±È½ÏÈÝÒ×Àí½â£¬ÏÂÃæÊÇÁ½Öֳɹ¦µÄ°¸Àý£¬ÆäÖÐÓÐÒ»¸öÊÇApache´úÌænginxµÄ°²×°£¬Ï£Íû¶Ô´ó¼ÒÓÐËù°ïÖú¡£
° ......