MySQL¶à±íͬʱ²åÈë
Real example:
/*************************by garcon1986*********************************************************/
<?php
// get the values from entreprise creation form
$secteur = $_POST['secteur'];
$nom = $_POST['nom_entreprise'];
$taille = $_POST['taille_entreprise'];
$concurrent = $_POST['concurrent_entreprise'];
$investisseur = $_POST['investisseur_entreprise'];
$partenaire = $_POST['partenaire_entreprise'];
$client = $_POST['client_entreprise'];
$fournisseur = $_POST['fournisseur_entreprise'];
$info_general = $_POST['information_generale'];
//connection
//include("./conn/connect.php");
$conn = mysql_connect("localhost","charles","charles") or die("connection failed: ".mysql_error());
mysql_select_db("crm") or die("select db failed: ".mysql_error());
//execution - using trasaction
mysql_query('START TRANSACTION',$conn) or die(mysql_error());
mysql_query("insert into entreprise(nom, nombre_salarie, secteur, info_general) values('".$nom."','".$taille."','".$secteur."','".$info_general."')",$conn) or die(mysql_error());
$id = mysql_insert_id($conn) or die(mysql_error());
mysql_query("insert into concurrent(entreprise_id, nom) values('".$id."', '".$concurrent."')",$conn) or die(mysql_error());
mysql_query("insert into investisseur(entreprise_id, nom) values('".$id."', '".$investisseur."')",$conn) or die(mysql_error());
mysql_query("insert into partenaire(entreprise_id, nom) values('".$id."', '".$partenaire."')",$conn) or die(mysql_error());
mysql_query("insert into client(entreprise_id, nom) values('".$id."', '".$client."')",$conn) or die(mysql_error());
mysql_query("insert into fournisseur(entreprise_id, nom) values('".$id."', '".$fournisseur."')",$conn) or die(mysql_error())
Ïà¹ØÎĵµ£º
¾ßÓиºÔؾùºâ¹¦ÄÜMySQL·þÎñÆ÷¼¯Èº²¿ÊðʵÏÖ
http://www.realure.cn/2009_241.html
http://www.realure.cn/2009_242.html
http://www.realure.cn/2009_243.html
http://www.realure.cn/2009_244.html
http://www.realure.cn/2009_245.html ......
×öÏîĿʱÓÉÓÚÒµÎñÂß¼µÄÐèÒª£¬±ØÐë¶ÔÊý¾Ý±íµÄÒ»Ðлò¶àÐмÓÈëÐÐËø£¬¾Ù¸ö×î¼òµ¥µÄÀý×Ó£¬Í¼Êé½èÔÄϵͳ¡£¼ÙÉè
id=1
µÄÕâ±¾Êé¿â´æÎª
1
£¬µ«ÊÇÓÐ
2
¸öÈËͬʱÀ´½èÕâ±¾Ê飬´Ë´¦µÄÂ߼Ϊ
Select restnum from book where id =1 ;
-- Èç¹û restnum ´óÓÚ 0 £¬Ö´ÐÐ update
Update boo ......
ÅäÖÃMySQLÖ÷´Ó¸´ÖÆ(Replication)
±êÇ©£ºÖªÊ¶/̽Ë÷ mysql¸´ÖÆ replication mysql±¸·Ý
·ÖÀࣺÊý¾Ý¿â
MySQLÖ§³Öµ¥Ïò¡¢Òì²½¸´ÖÆ£¬¸´Öƹý³ÌÖÐÒ»¸ö·þÎñÆ÷³äµ±Ö÷·þÎñÆ÷£¬¶øÒ»¸ö»ò¶à¸öÆäËü·þÎñÆ÷³äµ±´Ó·þÎñÆ÷¡£Ö÷·þÎñÆ÷½«¸üÐÂдÈë¶þ½øÖÆÈÕÖ¾Îļþ£¬²¢Î¬»¤ÈÕÖ¾ÎļþµÄÒ»¸öË÷ÒýÒÔ¸ú×ÙÈÕ־ѻ·¡£µ±Ò»¸ö´Ó·þÎñ ......
Ò»¡¢MYSQLµÄµ¼³ö
½øÈëmysql°²×°Ä¿Â¼£¬½øÈëbin
ÔÚÃüÁîÐÐģʽÏ´òÈ룺
³ÌÐò´úÂë
mysqldump -u root -p hibernate > c:/hibernate.sql
ÆäÖÐ-u ±íʾÓû§
-p±íʾÓû§ÐèÒªÈÏÖ¤
hibernate±íʾҪµ¼³öµÄÊý¾Ý¿â
> c:/hibernate ±íʾ½«Ê ......
±¾ÎÄÀ´×Ô: ITÔËάר¼ÒÍø ×÷Õß: NetSeek ÈÕÆÚ: 2009-3-8 19:52 ÔĶÁ: 742 ÈË ´òÓ¡ ÊÕ²Ø DNS, Bind, DLZ, ÖÇÄÜ, MySQL ×÷Õß:NetSeek http://www.linuxtone.org
ÈÕÆÚ:2009-3-7 gmail:cnseek@gmail.com
ÍÆ¼öÏÂÔØPDF°æ£¨·½±ã²éÔÄ):http://www.linuxtone.org/project/cdn/bind-dlz-view.pdf
¡¾Ìâ ¸Ù¡ ......