Solved

Php  POSTGRES  "  IN SIDE "  "

Posted on 2016-10-13
4
98 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 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

Independent Software Vendors: 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

Suggested Solutions

Title # Comments Views Activity
php date function ( diffrence between two dates ) 6 40
Length of for loop to be dynamic 2 31
How Close unsubmited attempts 10 42
MySqli Real Escape String and SQL Injection 1 43
This article discusses how to create an extensible mechanism for linked drop downs.
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

679 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