PHP Ïò±íÖÐÌí¼Ó¼Ç¼
Ïò±íÖÐÌí¼Ó¼Ç¼£¬Í¨³£ÒªÊ¹ÓÃÈçϵÄSQLÓï¾ä¡£
INSERT INTO $table_name(field1,field2,field3,......)values('value1','value2','value3'......)
ÆäÖÐ$table_name Ϊָ¶¨µÄ±íÃû£»field1¡¢field2¡¢field3·Ö±ðΪ±íÖÐ×Ö¶ÎÃû£»value1¡¢value2¡¢value3Ôò·Ö±ðΪ×Ö¶Îfield1¡¢field2¡¢field3Ëù¶ÔÓ¦µÄÖµ¡£
ʵÀýÈçºÎÌí¼Óмͼ£º
<?php
$hostname="datahost";
$dbuser="sa";
$dbpasswd="123";
$dbname="tempdb";
$conn=mssql_connect($hostname,$dbuser,$dbpasswd);
mssql_select_db($dbname);
$t_name="my_table";
$insert_t="insert into $t_name(id,name)values('1','ÕÅÈý')";
$result=mssql_query($insert_t,$conn);
if ($result)
{
echo"<font color=#666666>Òѳɹ¦Ïò±í</font><strong><font color=green>".$t_name."</font></strong><font color=#666666>ÖÐÌí¼Ó¼Ç¼£¡</font>";
}
else
{
echo"Ìí¼Óʧ°ÜÁË£¡";
}
mssql_close($conn);
?>
½á¹ûÑÝʾ£ºhttp://mingking.limewebs.com/db/insert_fields.php
Ïà¹ØÎĵµ£º
°²×°»·¾³£ºVMware Workstation 5.5.0 build-18463
Linux°æ±¾£ºRed Hat Enterprise Linux AS (2.6.9-42.EL)
Èí¼þ°æ±¾£ºMySQL5 - mysql-5.0.37.tar.gz
¡¡¡¡¡¡¡¡¡¡Apache2 - httpd-2.2.4.tar.gz
¡¡¡¡¡¡¡¡¡¡PHP5 - php-5.2.1.tar.gz
¡¡¡¡¡¡¡¡¡¡(½«ÒÔÉÏÎļþ±£´æÖÁ/home/tmpĿ¼)
[MySQL]
# cd /home/tmp (½øÈëѹËõ°ü ......
±¾ÎÄÈí¼þµÄÏÂÔصØÖ·¾Í²»Áгö£¬Ö÷ÒªÊǼǼ°²×°Ê±µÄ²½Öè¼°Ïà¹ØÎÊÌâµÄ´¦Àí·½·¨£»»ùÓÚ°²×°·½·¨Ä¿Ç°ÓÐÁ½ÖÖ£¬Ò»ÖÖÊÇÀûÓÃRPM°ü°²×°£¬Ò»ÖÖÔ´Âë±àÒë°²×°£»ÒÔÏÂÖ÷
ÒªÊÇÒÔÔ´Âë±àÒë°²×°£»ÒòΪԴÂë°²×°Èí¼þµÄÏ໥ÒÀÀµÐÔС£¬°²×°·½Ê½Óø÷ÖÖunix/linuxϵͳ£¬Î¬»¤·½±ã¡£Èç¹ûÏëÈ¥³ýÏà¹Ø·þÎñʱ£¬Ö±½Órm
–rfĿ¼ ¼´¿É£»½¨Òé²ÉÓÃÔ´Âë· ......
PHPÖвå¼þ»úÖƵÄÒ»ÖÖʵÏÖ·½°¸
ÕâƪÎÄÕµijö·¢µãÊÇÓÉÓÚÒ»ÅóÓÑÎÊÎÒÊÇ·ñ»á²å¼þ£¬ÒÔ¼°¶Ô²å¼þ»úÖÆÊÇ·ñÀí½â£¬¼°ÆäÔÚPHPÖеÄʵÏÖ¡£ÎÒµ±Ê±ÈÏΪ²»¾ÍÊÇÒ»¸ö¹¦ÄܵÄʵÏÖô£¬ºÇºÇ¡£Ïë·¨ºÜ¼òµ¥£¬ÔÚÍøÉϲéÁËһϣ¬²ÅÖªµÀÔÀ´²»ÊÇÄÇô¼òµ¥µÄÒ»»ØÊ£¬ÔÚÍøÉÏժ¼ÁËÒ»¸ö·½·¨£¬´Ë·½°¸½öÊDzå¼þ»úÖÆÔÚPHPÖеÄʵÏÖ·½°¸Ö®Ò»£¬ÕªÂ¼ÏÂÀ´ºÍ´ó¼Ò·Ö ......
1 MYSQLÖеÄ×Ö·û¼¯¸ÅÄî
MysqlµÄ×Ö·û¼¯ÀïÓÐÁ½¸ö¸ÅÄһ¸öÊÇ"Character set£¨×Ö·û¼¯£©"£¬ÁíÒ»¸öÊÇ"Collations"¡£
1.1 Collations
Collations·³ÉÖÐÎÄÊÇ"УÑé"£¬ÔÚÍøÒ³¿ª·¢µÄ¹ý³ÌÖУ¬Õâ¸ö´Ê»ã£¬Ö»ÔÚMysqlÀïʹÓã¬Ö÷Òª×÷ÓÃÊÇÖ¸µ¼Mysql¶Ô×Ö·ûµÄ±È½Ï£¬±ÈÈ磬 ASCII×Ö·û¼¯ÀCol ......
PHPÖÐÒýÓÃÖ¸µÄÊDz»Í¬µÄÃû×Ö·ÃÎÊͬһ¸ö±äÁ¿ÄÚÈÝ. µ«ÕâÓë£ÃÓïÑÔÖеÄÖ¸ÕëÊÇÓвî±ðµÄ£®£ÃÓïÑÔÖеÄÖ¸ÕëÀïÃæ´æ´¢µÄÊDZäÁ¿µÄÄÚÈÝÔÚÄÚ´æÖдæ·ÅµÄµØÖ·¡£
¹ØÓÚ¶Ô±äÁ¿£¬º¯Êý»òÕßÀàµÄÒýÓò»¶à˵£¬µ«ÒªËµÒ»ÏÂunsetÒ»¸öÒýÓã¬Ê¾Àý£º
<?php
$a = "hello";
$b =&$a;
unset($b);
echo '$a:'.$a;
//output:$a:hello
?> ......