- 论坛徽章:
- 0
|
請問各位有沒有php版,可以格式化mysql query的function呢?
小弟google了好一段時間,連一個也沒有呢
我要的是像這樣的function
http://awads.net/wp/2005/12/12/format-your-sql-the-easy-way/
function formatSQL(){
....
}
str="select a,b,c,d from table1 as t1 inner join table2 on t1.a=t2.a left join (select * from table4) as t3 group by a having sum(a) >100";
echo formatSQL($str);
結果如下
----------------------------------------------------
select a,b,c,d from table1 as t1
inner join table2 on t1.a=t2.a
left join (
select * from table4
) as t3
group by a
having sum(a) >100 |
|