Link to home
Start Free TrialLog in
Avatar of MrTV
MrTVFlag for Thailand

asked on

Php POSTGRES " IN SIDE " "

this code is not work in postgres  when I use macro
sc_exec_sql("  sql    ")    I think problem come from "   inside " "


sc_exec_sql("  SELECT 
  pong8."Last", 
  pong8."Timestamp", 
  pong8."Trade Volume", 
  pong8."Bid Size", 
  pong8."Ask Size", 
  pong8."Best Ask"
FROM 
  public.pong8;
    ");

Open in new window


but this below i test it work   (HOW CAN i FIX " iNSIDE "  " )
SELECT 
  pong8."Last", 
  pong8."Timestamp", 
  pong8."Trade Volume", 
  pong8."Bid Size", 
  pong8."Ask Size", 
  pong8."Best Ask"
FROM 
  public.pong8;

Open in new window

Avatar of Sharath S
Sharath S
Flag of United States of America image

try escaping them.
sc_exec_sql("  SELECT 
  pong8.\"Last\", 
  pong8.\"Timestamp\", 
  pong8.\"Trade Volume\", 
  pong8.\"Bid Size\", 
  pong8.\"Ask Size\", 
  pong8.\"Best Ask\"
FROM 
  public.pong8;
    ");

Open in new window

Avatar of MrTV

ASKER

Parse error: syntax error, unexpected 'Timestamp' (T_STRING) in C:\Program Files (x86)\NetMake\v81\wwwroot\scriptcase\app\Pong8\blank\index.php on line 1079


sc_exec_sql("CREATE TABLE StepOneSection as
SELECT

public.pong8.\"Timestamp\",
public.pong8.\"Last\",
public.pong8.\"Trade Price\",
public.pong8.\"Trade Volume\",
public.pong8.\"Best Bid\",
public.pong8.\"Bid Size\",
public.pong8.\"Best Ask\",
public.pong8.\"Ask Size\",
public.pong8.\"Turnover\"
FROM
Public.pong8
") ;

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Sharath S
Sharath S
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MrTV

ASKER

thank you