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

php+mysqlÖеÄһЩÓï¾ä

mysql½¨Á¢Ò»¸ö±í¸ñ£º
create table hyhtbsc(
id int(4) primary key auto_increment,
username varchar(20),
password varchar(20)
);
²éѯÊý¾Ý¿âÄÚÈÝ£º
<?php
$conn = mysql_connect("localhost","root","pass");
mysql_select_db("mydb",$conn);
$sql = "select * from mytable";
$result = mysql_query($sql,$conn);
while($row = mysql_fetch_array($result)){
echo "<td>".$row['myfield']."</td>";
}
mysql_free_result($result);
mysql_close($conn);
?>
Ìí¼ÓÊý¾Ý¿âÄÚÈÝ£º
<?php
$id=trim($_POST['id']);
$conn = mysql_connect("localhost","root","pass");
mysql_select_db("mydb", $conn);
if($id != ''){
$sql="INSERT INTO ggs_chapter (id) VALUES ('".$book_id."')";
mysql_query($sql,$conn);

echo 'Ìí¼Ó³É¹¦£¡';
}
?>
<form name="add_book" action="" method="post">
<table>
<tr><td>
<select name="id">
<?php
$sql="select * from table";
$result=mysql_query($sql,$conn);
while($row = mysql_fetch_array($result)){
echo "<option value=\"".$row['id']."\">".$row['name']."</option>";
}
mysql_free_result($result);
mysql_close($conn);
?>


Ïà¹ØÎĵµ£º

PHP×Ö·û´®½Ì³Ì_trimº¯Êý

PHP trim() º¯Êý
¶¨ÒåºÍÓ÷¨
trim() º¯Êý´Ó×Ö·û´®µÄÁ½¶Ëɾ³ý¿Õ°××Ö·ûºÍÆäËûÔ¤¶¨Òå×Ö·û¡£
Óï·¨
trim(str,charlist)
 ²ÎÊý 1 strΪ´ý²Ù×÷µÄ×Ö·û´®£¬²ÎÊý 2 charlist ¿ÉÑ¡£¬Ö¸¶¨ÁËÏëҪȥ³ýµÄÌØÊâ·ûºÅ¡£
Èç¹ûµÚ¶þ¸ö²ÎÊýû¸øÖµ£¬Ô¤Éè»áÈ¥³ýÏÂÁÐÕâЩ×ÖÔª£º 
" " (ASCII 32 (0x20) ......

ÎÒµÄMysqlÖØװʧ°Ü£¬½â¾ö°ì·¨

ÖØа²×°£¬³öÏÖ/etc/init.d/mysql: line 115: /etc/mysql/debian-start: ûÓиÃÎļþ»òĿ¼
invoke-rc.d: initscript mysql, action "start" failed.
ʹÓÃÃüÁsudo aptitude purge mysql-server mysql-server-5.0
È»ºóÔÚÖØа²×°....
apt-get install mysql-server-5.0 ......

php+mysql

¿´µ½IEÀïÃæÏÔʾ“Á¬½Ó³É¹¦”µÄ»­Ãæʱ£¬ÕæµÄºÜÐË·Ü¡£Á½ÌìµÄŬÁ¦Ã»°×·Ñ¡£
ÏÖÔÚÀ´×ܽáһϣ¬ÔõôÈÃphpÓëMySQLÁ¬½Ó¡£Ìù³öÀ´£¬ÎªºóÀ´Ñ§Ï°µÄÈËÉÙµã×èÁ¦£¡
ÎÒÓõÄÊÇapache+windows+php+MySQL
´óÌå˵À´ÓÐÁ½ÖÖ·½Ê½£¬Ò»ÖÖÊǾɵÄÃæÏò¶Ô¹ý³ÌµÄ·½Ê½£¬ÐèҪװÔØphp_mysql.dll£»ÁíÒ»ÖÖÊÇеÄÃæÏò¶ÔÏóµÄ·½Ê½£¬ÐèҪװÔØphp_mysql ......

PHP mysqlÊÂÎñ´¦Àí »Ø¹ö²Ù×÷

MYSQLÖÐÖ»ÓÐINNODBºÍBDBÀàÐ͵ÄÊý¾Ý±í²ÅÄÜÖ§³ÖÊÂÎñ´¦Àí£¡ÆäËûµÄÀàÐÍÊDz»Ö§³ÖµÄ£¡
$lnk = mysql_connect("localhost", "root", "");
mysql_select_db("test");
mysql_query("BEGIN");
$query = mysql_query("INSERT INTO test VALUES(1, 'yangjun')&quo ......

ÈçºÎ±àдPHPÀ©Õ¹

 ¼ò ½é
PHPÈ¡µÃ³É¹¦µÄÒ»¸öÖ÷ÒªÔ­ÒòÖ®Ò»ÊÇËýÓµÓдóÁ¿µÄ¿ÉÓÃÀ©Õ¹¡£web¿ª·¢ÕßÎÞÂÛÓкÎÖÖÐèÇó£¬ÕâÖÖÐèÇó×îÓпÉÄÜÔÚPHP·¢ÐаüÀïÕÒµ½¡£PHP·¢Ðаü°üÀ¨Ö§³Ö¸÷ÖÖÊý¾Ý¿â£¬Í¼ÐÎÎļþ¸ñʽ£¬Ñ¹Ëõ£¬XML¼¼ÊõÀ©Õ¹ÔÚÄÚµÄÐí¶àÀ©Õ¹¡£
À©Õ¹APIµÄÒýÈëʹPHP3È¡µÃÁ˾޴óµÄ½øÕ¹£¬À©Õ¹API»úÖÆʹPHP¿ª·¢ÉçÇøºÜÈÝÒ׵Ŀª·¢³ö¼¸Ê®ÖÖÀ©Õ¹¡£ÏÖÔÚ£¬Á½¸ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ