怎么把powerdesigner导出的sql用PHP导入MysQL数据库
我们知道用powerdesigner导出的sql文件后缀为'.sql';用phpmyadmin很容易导入MysQL数据库,但是用PHP怎么导入数据库呢?
我用powerdesigner设计一个数据库后导出sql文件(一个投票系统)为'vote.sql';
文件内容为(一些sql语句和注释):
/*==============================================================*/
/* DBMS name: MySQL 5.0 */
/* Created on: 2010-4-22 17:11:50 */
/*==============================================================*/
drop table if exists account_charge;
drop table if exists account_cost;
drop table if exists account_info;
drop table if exists charge_way;
drop table if exists user_askanswer;
drop table if exists user_info;
drop table if exists vote_fake;
drop table if exists vote_info;
drop table if exists vote_item;
drop table if exists vote_title;
drop table if exists vote_type;
/*==============================================================*/
/* Table: account_charge */
/*==============================================================*/
create table account_charge
(
chargeid int not null,
chargewayid int not null,
accountid
相关文档:
上一篇我们讲到链接到 Edit.php?id= 来修改数据,后来我想了一下,其实也可以直接利用 Input.php 来修改数据,这样更容易管理,节省了不必要的空间
Input.php可以这样链接:Input.php?id=[Num]&action=[Num]
id即记录ID,默认为-1
action为动作,默认为0 , 为0时代表添加新的记录,为1时则修改记录
In ......
哎,还是上周的事情了,csdn的博客最近咋老是打不开呢!
基本语句:Alter table 表名 drop Column 字段名
另单单是这样是不行滴,还要删除对应的关系滴。下面就把查找到的那篇文章引用下吧!
原文地址:http://hi.baidu.com/lisky119/blog/item/3c348c082573949c0a7b82d1.html
SET ANSI_NULLS ON
GO
SET QUOTED_IDENT ......
1. select top pageSize
* from table where id not in(select top((pageNo-1)*pageSize
) id from table order by id asc)
2. select * from table where id<=pageSize*pageNo
and id>(pageNo-1)*pageSize
order by id asc
注:
pagesize每页显示的记录数
pageNo当前第几页
......
begin
for item in (select * from user_constraints a where a.constraint_type = 'R') loop
execute immediate 'alter table ' || item.table_name || ' disable constraint ' || item.constraint_name;
end loop;
end;
/ ......
SQL函数 left()、charindex()的使用
1、left()
LEFT (<character_expression>, <integer_expression>)
返回character_expression 左起 integer_expression 个字符。
2.charindex()
返回字符串中某个指定的子串出现的开始位置。
CHARINDEX (<’substring_expression’>, <expressio ......