在phpmyadmin(wamp服务器)

时间:2015-12-29 04:18:04

标签: php mysql database

我试图在android中使用php mysql db在后端制作简单的登录注册应用程序..当我尝试执行以下查询时,我在phpmyadmin中收到错误

代码:

create database android_api /** Creating Database **/

use android_api /** Selecting Database **/

create table users(
   id int(11) primary key auto_increment,
   unique_id varchar(23) not null unique,
   name varchar(50) not null,
   email varchar(100) not null unique,
   encrypted_password varchar(80) not null,
   salt varchar(10) not null,
   created_at datetime,
   updated_at datetime null
); /** Creating Users Table **/

错误:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'use android_api /** Selecting Database **/

create table users(
   id int(11' at line 3 

我也想知道..以下教程说我在同一个wifi网络上需要两台机器来运行php n android ..不能在同一台机器上运行吗?部署后怎么样?

2 个答案:

答案 0 :(得分:1)

尝试以下方法。创建一个数据库,使其不受你的影响。

<nav id="bt-menu" class="bt-menu">
                <a href="#" class="bt-menu-trigger" id="bt-icon icon-gplus" ><br><span>Menu
                <ul > 
                        <li style="text-align:center;"><a href="index.php"><span>DashBoard</span></a></li>
                        <li style="text-align:center;"><a href="user.php"><span>User </span></a></li>
                        <li style="text-align:center;"><a href="candidates.php"><span>Candidates</span></a></li>
                        <li style="text-align:center;"><a href="party.php"><span>Partylist</span></a></li>
                        <li style="text-align:center;"><a href="position.php"><span>Position</span></a></li>
                        <li style="text-align:center;"><a href="program.php"><span>Program</span></a></li>
                        <li style="text-align:center;"><a href="department.php"><span>Department</span></a></li>
                        <li style="text-align:center;"class="active"><a href="syear.php"><span>School-Year</span></a></li>
                        <li style="text-align:center;"><a href="reports.php"><span>Reports</span></a></li>
                        <li style="text-align:center;"><a href="#"><span>Logs</span></a>
         <ul class="sub-menu" style="text-align:right">
        <li><a href="#" style="text-align:right;">Submenu</a></li>
            </ul></li>
                </ul>
            </nav>

答案 1 :(得分:0)

运行:

create database android_api; 

use android_api;

create table users(
   id int(11) primary key auto_increment,
   unique_id varchar(23) not null unique,
   name varchar(50) not null,
   email varchar(100) not null unique,
   encrypted_password varchar(80) not null,
   salt varchar(10) not null,
   created_at datetime,
   updated_at datetime null
);