MrTV
asked on
PHP Put variable in sql postgresql scriptcase
the code below when i put table name it work then i put variable name {TabName} it does not work how can i fix it
Parse error: syntax error, unexpected 'scriptcase' (T_STRING) in C:\Program Files (x86)\NetMake\v81\wwwroot\ scriptcase \app\Pong8 \bla nk\index.php on line 1142
I do with scriptcase it a php deleloping tool
Parse error: syntax error, unexpected 'scriptcase' (T_STRING) in C:\Program Files (x86)\NetMake\v81\wwwroot\
I do with scriptcase it a php deleloping tool
sc_lookup(Dataset, "SELECT tablename FROM pg_catalog.pg_tables
where schemaname = 'public'and tablename not like 'pong8%' order by tablename") ;
{TabName} = {Dataset[33][0]};
echo "{TabName} " ;
$sql ='INSERT INTO pong8_maintable ("timestamp8","Last","TradePrice", "TradeVolume" , "BestBid")
SELECT
cast(public.'.{TabName}.'"Timestamp" as timestamp) ,
cast(public.'.{TabName}.'"Last" as numeric) ,
cast(public.'.{TabName}.'"Trade Price" as numeric) ,
cast(public.'.{TabName}.'"Trade Volume" as numeric),
cast(public.'.{TabName}.'"Best Bid" as numeric)
FROM Public.'.{TabName}.' ;
And if you replace
cast(public.'.{TabName}.'"Timestamp" as timestamp)
withcast(public.'.{$TabName}.'"Timestamp" as timestamp)
ASKER
sc_lookup(Dataset, "SELECT tablename FROM pg_catalog.pg_tables
where schemaname = 'public'and tablename not like 'pong8%' order by tablename") ;
{TabName} = {Dataset[33][0]};
echo "{TabName} " ;
$sql ='INSERT INTO pong8_maintable ("timestamp8","Last","TradePrice", "TradeVolume" , "BestBid")
SELECT
cast(public.gel."Timestamp" as timestamp) ,
cast(public.gel."Last" as numeric) ,
cast(public.gel."Trade Price" as numeric) ,
cast(public.gel."Trade Volume" as numeric),
cast(public.gel."Best Bid" as numeric)
FROM Public.'.{TabName};
sc_exec_sql($sql);
this code is work bur how can I change cast(public.gel."Best Bid" as numeric) to cast(public. {TabName}."Best Bid" as numeric) like last line
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Open in new window