今日課程:PHP 3天基礎鞏固視頻教程【燕十八】php
一、apache安裝和虛擬主機配置mysql
二、安裝mysqlsql
3.mysql入門語句數據庫
//連接數據庫服務器 mysql -h localhost -u root -p //查看庫 show detabases //選庫 use 庫名 //查看庫下面的表 show tables //建表 cerate tables msg( id int auto_increment primary key, content varchar(200), pubtime int )charset utf8; //告訴服務區字符集 set names gbk/utf8; //添加數據 insert into msg(id,content,pubtime) balyes (1.'222',130123); //查詢因此數據 select * form msg where id=2/1/1^ //快速清空表 truncate 代表
四、提交留言到MYSQLapache
//鏈接mysql $conn = mysql_connect('192.168.1.2','root','***'); //發送查詢 mysql_query('use test',$conn); mysql_query('set names utf8',$conn); //接收post信息 #sql = "inset into liuyan(title,content,pubtime) values ('"$_POST['title']."','".$_POST['content']."',".time().");"" //echo #sql if(mysql_query($sql.$conn)){ echo "yes"; }else{ echo "no"; }