Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Php  POSTGRES  "  IN SIDE "  "

Posted on 2016-10-13
4
Medium Priority
?
147 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 41

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 41

Accepted Solution

by:
Sharath earned 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
In this article, we’ll look at how to deploy ProxySQL.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

886 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