PHP???????????????????????д??
???????????? ???????[ 2014/8/8 11:23:50 ] ????????PHP ?????
?????????????????(php+Mysql)??????????????:
????????:php????MySql
????1.???????????????????????????????????漰???????????.
????$mysql_server_name='localhost'; //????????mysql??????????
????$mysql_username='root'; //????????mysql??????????
????$mysql_password='123456'; //????????mysql?????????
????$mysql_database='Mydb'; //????????mysql???????
???????????????????????????????????????????????.
????????: ?????????????:db_config.php ??????????????????????????????.
???????????:require("db_config.php");
????2.?????????
????$conn=mysql_connect($mysql_server_name??$mysql_username??$mysql_password) or die("error connecting") ; //?????????
????mysql_query("set names 'utf8'"); //???????????? ?????????????????????.?????????蹫????????PHP???????????UTF-8 ??????????.
????mysql_select_db($mysql_database); //???????
????$sql ="select * from news "; //SQL???
????$result = mysql_query($sql??$conn); //???
????3.??????е????????????????while???????????????????for ????????.
????while($row = mysql_fetch_array($result))
????{
????echo "<div style="height:24px; line-height:24px; font-weight:bold;">"; //??????
????echo $row['Topic'] . "<br/>";
????echo "</div>"; //??????
????}
????4.phpд???????Mysql?????д??
????$conn=mysql_connect($mysql_server_name??$mysql_username??$mysql_password); //?????????
????mysql_query("set names 'utf8'"); //????????????
????mysql_select_db($mysql_database); //???????
????$sql = "insert into messageboard (Topic??Content??Enabled??Date) values ('$Topic'??'$Content'??'1'??'2011-01-12')";
????mysql_query($sql);
????mysql_close(); //???MySQL????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11