Home > Database > Mysql Tutorial > Mac下MAMP初试体验_MySQL

Mac下MAMP初试体验_MySQL

WBOY
Release: 2016-06-01 13:16:27
Original
888 people have browsed it

原创文章,转载请注明出处!

最近小学习了一下Mac下的Apache,Mysql,php。这里记录一下,以备忘

1 php

1.1 php返回值的测试

     在MAMP下测试成功,直接echo返回所数据

1.2 php调试环境

  • 用komodo这个IDE可以断点调试一些东西,但机器上安装好之后,不能Debug,

Failed to configure for local php debugging

  • 还是用emacs编辑,
  • 在Terminal里,简单看一下语法问题。
  • 在chrome里,或通过项目上调试内容

1.3 php对protobuff对象解析

  • protobuf库依赖

require_once(PRO_ROOT.'/message/pb_message.php');

  • 业务逻辑库依赖

require_one(PRO_ROOT.'/message_proto/pb_protohbcommand.php');

  • 读取请求数据

$l_requestContent = file_getcontents("php://input");

  • 构造对象

$l_requestCommand = new RequestCommand();

  • 填充内容

$l_requestCommand->parseFromString($l_requestContent);

  • 解析字段

echo($l_request->loginRequest()->user_data()->user_id());

2 mysql

2.1 mamp中mysql命令

alias mysql='/Applications/MAMP/Library/bin/mysql'

2.2 mysql命令

2.2.1 Remove this Database

if(mysql_num_rows(mysql_query("show databases like '"."test_database"."'"))==1){

drop database test_database;

}

2.2.2 Create New Database

create database test_database;

2.2.3 Create Table

.....
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template