Commit 143c97f5 authored by Medicean's avatar Medicean

(Fix:DataBase) fix php postgresql template code syntax error

parent d42b4d64
...@@ -25,11 +25,11 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({ ...@@ -25,11 +25,11 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$cs .= "$k=$v "; $cs .= "$k=$v ";
} }
$T=@pg_connect($cs); $T=@pg_connect($cs);
if(!T){ if(!$T){
echo("ERROR://".@pg_last_error()); echo("ERROR://".@pg_last_error());
}else{ }else{
$q=@pg_query($T,"SELECT datname FROM pg_database where datistemplate='f';"); $q=@pg_query($T,"SELECT datname FROM pg_database where datistemplate='f';");
if(!q){ if(!$q){
echo("ERROR://".@pg_last_error()); echo("ERROR://".@pg_last_error());
}else{ }else{
while($rs=@pg_fetch_row($q)){ while($rs=@pg_fetch_row($q)){
...@@ -66,7 +66,7 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({ ...@@ -66,7 +66,7 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$cs .= "$k=$v "; $cs .= "$k=$v ";
} }
$T=@pg_connect($cs); $T=@pg_connect($cs);
if(!T){ if(!$T){
echo("ERROR://".@pg_last_error()); echo("ERROR://".@pg_last_error());
}else{ }else{
$q=@pg_query($T,"SELECT table_name FROM information_schema.tables WHERE table_type='BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema');"); $q=@pg_query($T,"SELECT table_name FROM information_schema.tables WHERE table_type='BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema');");
...@@ -109,11 +109,11 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({ ...@@ -109,11 +109,11 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$cs .= "$k=$v "; $cs .= "$k=$v ";
} }
$T=@pg_connect($cs); $T=@pg_connect($cs);
if(!T){ if(!$T){
echo("ERROR://".@pg_last_error()); echo("ERROR://".@pg_last_error());
}else{ }else{
$q=@pg_query($T,"SELECT column_name,udt_name,character_maximum_length FROM information_schema. COLUMNS WHERE TABLE_NAME = '{$tab}';"); $q=@pg_query($T,"SELECT column_name,udt_name,character_maximum_length FROM information_schema. COLUMNS WHERE TABLE_NAME = '{$tab}';");
if(!q){ if(!$q){
echo("ERROR://".@pg_last_error()); echo("ERROR://".@pg_last_error());
}else{ }else{
while($rs=@pg_fetch_row($q)){ while($rs=@pg_fetch_row($q)){
...@@ -155,11 +155,11 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({ ...@@ -155,11 +155,11 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$cs .= "$k=$v "; $cs .= "$k=$v ";
} }
$T=@pg_connect($cs); $T=@pg_connect($cs);
if(!T){ if(!$T){
echo("ERROR://".@pg_last_error()); echo("ERROR://".@pg_last_error());
}else{ }else{
$q=@pg_query($T, $sql); $q=@pg_query($T, $sql);
if(!q){ if(!$q){
echo("ERROR://".@pg_last_error()); echo("ERROR://".@pg_last_error());
}else{ }else{
$n=@pg_num_fields($q); $n=@pg_num_fields($q);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment