Solved

Php  POSTGRES  "  IN SIDE "  "

Posted on 2016-10-13
4
37 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
thank you
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now