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())
Ïà¹ØÎĵµ£º
Tomcat ÏÂ×îÈÝÒ×µ½µÄÎÊÌâ¾ÍÊÇÖÐÎÄÂÒÂëÎÊÌâÁË , ÏÂÃæ¾ÍÀ´Ì¸Ì¸ÎÒÔÚ Windows +Tomcat5 ϵ÷ÊÔ JSP ³ÌÐòʱ , ËùÅöµ½µÄÎÊÌâÒÔ¼°½â¾ö°ì·¨¡£
Õâ´Îµ÷ÊÔËùÓöµ½µÄÂÒÂëÎÊÌâÖ÷ÒªÓÐÈýÀࣺ
Ò»¡¢ Ò³Ãæ×Ö·ûÂÒÂë¡£
¼´Õû¸öÒ³Ãæ³öÏÖºº×ÖÂÒ ......
µ¼ÈëÊý¾ÝÖ¸¶¨ÁÐ
load data local infile 'D:\\service_func_utf8.txt' into table service_func fields terminated by '\t' (service_id, func_id1, func_id2, func_id3, func_id4, func_id5, func_id6);
MYSQL½«²éѯ½á¹ûµ¼³öµ½Îļþ
select * from tablename into outfile '/tmp/test.txt';
MYSQLÁªºÏÖ÷¼ü
create  ......
ת×Ô£ºhttp://www.yayu.org/look.php?id=113
1£ºÔÚÖÕ¶ËÏ£ºmysql -V¡£
ÒÔÏÂÊÇ´úÂëÆ¬¶Î£º
[shengting@login ~]$ mysql -V
mysql Ver 14.7 Distrib 4.1.10a, for redhat-linux-gnu (i686)
2£ºÔÚmysqlÖУºmysql> status;
ÒÔÏÂÊÇ´úÂëÆ¬¶Î£º
mysql> status;
--------------
mysql ......
ÔÚMySQLÖУ¬¶ÔÓÚË÷ÒýµÄʹÓò¢ÊÇÒ»Ö±¶¼²ÉÓÃÕýÈ·µÄ¾ö¶¨¡£
¡¡¡¡¼òµ¥±íµÄʾÀý£º
¡¡¡¡create TABLE `r2` (
¡¡¡¡ID` int(11) DEFAULT NULL,
¡¡¡¡ID1` int(11) DEFAULT NULL,
¡¡¡¡CNAME` varchar(32) DEFAULT NULL,
¡¡¡¡KEY `ID1` (`ID1`)
¡¡¡¡) ENGINE=MyISAM DEFAULT charSET=latin1
¡¡¡¡select count(*) from r2;
¡¡ ......
±¾ÎÄÀ´×Ô: 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
¡¾Ìâ ¸Ù¡ ......