?? MySQL ????????6??????
???????????? ???????[ 2015/3/13 13:42:51 ] ????????????? MySQL PHP ???? ????
????MySQL???????????С?????????Ч?????????????????????????á????LAMP????WAMP???????е?????????MySQL???PHP????????????????????
????1.???????????÷??(;)???????
????????MySQL?????????????μ???????????????????÷??(;)?????????????????MySQL????????PHP??????????e???????????????磺
????mysql_query("INSERT INTO tablename(first_name??last_name)VALUES('$first_name'??$last_name')");
???????????PHP????????????е?????????????????????PHP?????????????????????????????á???????????£????????????????PHP?????MySQL????????????????????
????2.???ù????????????????
????????????????
????$connection=mysql_connect("localhost"??"albert"??"shhh");
????mysql_select_db("winestore"??$connection);
????$result=mysql_query("SELECT cust_id??surname??
????firstname FROM customer"??$connection);
????while($row=mysql_fetch_array($result))
????{
????echo"ID:t{$row["cust_id"]}n";
????echo"Surnamet{$row["surname"]}n";
????echo"First name:t{$row["firstname"]}nn";
????}
????????mysql_fetch_array()???????????з??????飬???????????????????????cust_id????????????????????$row["cust_id"]????$row[0]??????????????????????????
?????????????У???????????????????????????????
????SELECT winery.name AS wname??region.name AS rname??FROM winery??region WHERE winery.region_id=region.region_id;
?????????????????$row["wname"]??$row["rname"]
?????????????????????????£????????????
????SELECT winery.region_id
????FROM winery
?????????????????$row["region_id"]
???????????????????????????
????SELECT count(*)
????FROM customer;
?????????????????$row["count(*)"]
????3.TEXT??DATE????SET????????
????MySQL??????????????ж??????????????????д??25???????????????????????????????????м????б????????
????TEXT?????????????????????????Щ?????????????????????????“LONG VARCHAR”????“MEDIUMTEXT”??
????DATE?????????????YYYY-MM-DD?????磺1999-12-08???????????????date????????????????????????date(“Y-m-d”)???????DATA??????????????????????????????????????
????$age=($current_date-$birthdate);
????????SET??????????????????????????ENUM?е?????????????SET????????????ENUM????????????????????SET???????????64????????????ENUM?????????????65??535????????????????????д???64????????????????????????????????????????????????????
????4.??mysql_unbuffered_query()???????????
??????????????????滻mysql_query()?????????????????mysql_unbuffered_query()??????????????????????????????????????????????????????????mysql_num_rows()????????飬??????????????Сδ???
????5.????
????SQL?????????????“*”??“%”??????????????????????磺?????????????????????????????????????????
????SELECT*FROM dbname WHERE USER_ID LIKE'%';
???????????????????????????????????????????????????????κε???????????????????????????????С?“*”????????????????“%”??????????????????????????????????????“%”?????????LIKE??????????á?????????????????????“_”?????????????????治?????????????κε???????????
????6.NOT NULL?????
??????????????????κζ?????????°???submit???????????????????????????????????????????????????????????????????????????????????????????????Щ??α?????????????????????MySQL?????????Щ???飺?????NULL?????????????
?????????????ζ?????????????NOT NULL???????????????????ε??????MySQL?????????ο?????????????????????ENUM??????????Σ??????????????NOT NULL??MySQL???????????????????????С???????MySQL????????????????????????????????
?????????NULL??????????????????Щ??????%????????????????????????????NULL????????Щ????????????????Щ???????????????????????κ???ζ?????????NOT NULL??????????SELECT????????????????????????????NULL?????????“IS”????????LIKE???????????????????????????????????????????????μ???????????????????????Щ????????????????????????????е??????????NULL??????????????????MySQL?????Bug?????????????????£????SELECT????????С???
??????
???·???
??????????????????
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