lnmp学习

发布时间:2016-11-21 15:17:53 阅读:915次

mysql

1、连接服务器     mysql -uroot -p

2、显示所有数据库     show databases

3、使用数据库     use 库名

4、创建数据库     create database 库名

5、创建表     create table

6、查看表结构     desc 表名

7、显示所有表     show tables

8、改表名     alter table 表名 rename 新表名

9、添加数据     insert     into     表名(    字段1,    字段2,    ...    字段n    ) values(    '值1',    '值2',    ...    '值n'    ) 字段和值数量要一一对应

10、更新数据     update 表名 set 字段名=值 where 条件

11、查询数据     select *from 表名 where 条件

12、删除数据     delete from 表名 where 条件

13、添加列     alter table 表名 add 字段名 类型

14、删除列     alter table 表名 drop 字段名

15、修改列类型     alter table 表名 modify 字段名 新的类型

16、修改列名     alter table 表名 change 字段名 新的字段名 新的类型


php

1、echo输出

<?php
    echo "hello the world";
    #echo "hello the world";
    //echo "hello the world";
?>

2、print_r打印数组

<?php

    $array=array("username"=>"username1","sex"=>"M");

    print_r($array);

    print_r($array["username"]);

?>

3、字符串处理
<?php 
    $a="hello";

    $b="the world";

    $c=$a.$b;

    echo $c;

?>

4、if,while,for语句

<?php

$a=1;

if($a>0){

     echo "大于0";

}else{

     echo "小于0";

}

?>

$a=1;

while($a<10){

     echo $a;

     $i++;

}

for($i=1;$i<=10;$i++){

    echo $i."<br>";

}

$array=array("username"=>"username1","sex"=>"M");

foreach($array as $key=>$value){

    echo $key;

    echo $value;

}

5、函数

<?php

function hello(){

    echo "hello the world";

}

hello();


function hello2($str){

    return $str;

}

$a=hello2("test");

echo $a;

?>

6、_GET和_POST

$_GET

http://www.lnmp.video/index.php?a=lnmp&b=video

<?php

echo "<pre>";

print_r($_GET);

echo "</pre>";

echo $_GET["a"];

echo $_GET["b"];

?>

$_POST

<form name=myform method=post action=data.php>

<input type=text name=username>

<input type=password name=password>

<input type=submit value=提交>

</form>

cat data.php

<?php

echo "<pre>";

print_r($_POST);

echo "</pre>";

echo $_POST["username"];

echo $_POST["password"];

?>


ci,thinkphp,smarty,ajax

html,javascript

linux常用命令

nginx,mysql配置

mysql引擎

mysql索引

memcache

抢购

svn使用

samba

nfs

如有问题,可以QQ搜索群1028468525加入群聊,欢迎一起研究技术

支付宝 微信

有疑问联系站长,请联系QQ:QQ咨询
上一篇:mysql基础学习
下一篇:linux常用命令

转载请注明:lnmp学习 出自老鄢博客 | 欢迎分享