mysql php?????????
???????????? ???????[ 2017/2/21 10:46:01 ] ????????????? MySQL
????//???php????mysql
????// ??? mysqli ??? ???? ?????
????// ??????????????????У???php.ini ??extension=php_mysqli.dll
????// phpinfo();
????//1.?????????.
????$link = @mysqli_connect('localhost'??'root'??'root');
????// var_dump($link);
????//2.?ж??????????
????if(!$link){
????echo mysqli_connect_errno();//?????
????echo mysqli_connect_error();//???????
????exit;//????????б???
????}
????//3.???
????$res = mysqli_select_db($link??'t4');
????// var_dump($res);
????//4.?????????
????$ress = mysqli_set_charset($link??'utf8');
????// var_dump($ress);
????//5.???sql???
????$sql = 'select * from t4';
????//6.????sql???MySQL??????
????$result = mysqli_query($link??$sql);//???? boolean/object(???????)
????var_dump($result);
????//7.????????
????/*
????$row = mysqli_fetch_assoc($result); // ?????????е????????????
????$row = mysqli_fetch_assoc($result); // ?????????е?????
????$row = mysqli_fetch_assoc($result); // ?????????е?????
????$row = mysqli_fetch_assoc($result); // ?????????е?????
????$row = mysqli_fetch_assoc($result); // ?????????е?????
????var_dump($row);
????echo '<pre>';
????print_r($row);
????echo '</pre>';
????*/
????// ???????????????????е?????
????$userlist = [];
????while( $row = mysqli_fetch_assoc($result) ){
????$userlist[] = $row;
????}
????echo '<pre>';
????print_r($userlist);
????echo '</pre>';
????//8.??????
????mysqli_free_result($result);
????// 9.???????
????$res = mysqli_close( $link );
????var_dump($res);
????// ???????????????????????????????????
??????
???·???
??????????????????
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