Solved

Php  POSTGRES  "  IN SIDE "  "

Posted on 2016-10-13
4
91 Views
Last Modified: 2016-10-25
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

0
Comment
Question by:teera
  • 2
  • 2
4 Comments
 
LVL 40

Expert Comment

by:Sharath
ID: 41843007
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

0
 

Author Comment

by:teera
ID: 41843044
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

0
 
LVL 40

Accepted Solution

by:
Sharath earned 500 total points
ID: 41844599
try this.
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

0
 

Author Closing Comment

by:teera
ID: 41858335
thank you
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article discusses four methods for overlaying images in a container on a web page
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question