Re: [PHP] how to curl



On Sat, Aug 9, 2008 at 8:11 AM, mukesh yadav <mak.gnu@xxxxxxxxx> wrote:



remember, serverB should be speaking http. were you unable to understand
its usage looking at the manual,



Yes nathan i'm not able to understand how to pass the sql query can you
give me one small eg.

like

$sql = select * from table where id = $var ;

how i'll send this query using cURL to get the result. from remote server.

in manual i'm not able to find the way query executes.

thanks


mukesh,

im happy to respond, but please keep the conversation on the list, so that
others may benefit by having it available in the archives.

i have a few questions as well; is the query being executed on the provider
system (that is the one you intend to send the http request to)? also, are
you writing and deploying code to both of these systems, or just on the
consumer (the one you intend to execute the curl request from)?

either way, i can say that programmatic http interfaces are usually built to
deliver services, such as an api for an online application. these
interfaces offer methods much like those in php (or many other languages),
they take a well defined set of argumets, and have a well defined return
value.

in your case, i would expect the provider to expose some url that would
essentially represent the query you intend to execute. it would then expect
the consumer to provide an id during the request, so that it can use that in
the query. then it would return the result, nearly verbatim from the
database.

so, if the provider supported the method as http GET, you might see
something like this, which you would execute via curl,

http://myrestapi.com/getAllFromTable?id=56

then, the provider would grab the id right out of $_GET (if it were also
written in php).

-nathan


Relevant Pages

  • Re: Finally which ORM tool?
    ... of a query;), hence my question. ... IEnumerabledirectly but instead having an Execute method taking ... But it's not a problem with LINQ itself. ... Every Linq provider will implement ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Finally which ORM tool?
    ... you manipulate the linq query IF you're ... implement IEnumerablebut had an Execute() method which gave ... Every Linq provider will implement ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: Calling Ingres Database Procedures through .Net Data Provider
    ... Provider reads the result set produced by that procedure just as any result set produced by a query. ... The .NET application would execute the procedure and read the result set ... stored procedure in a way that it is accepted with open arms into a DataSet. ...
    (comp.databases.ingres)
  • Re: Finally which ORM tool?
    ... manipulate the linq query IF you're executing it at that moment. ... simply because the declaration construction was with 'CHOPS'. ... implement IEnumerablebut had an Execute() method which gave back ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: SQL stored procedure executing twice
    ... I wasn't aware that DLookupwould execute the "domain" more than once. ... caused the stored procedure to execute twice. ... Dim stDocName As String ... My pass-thru query properties ...
    (microsoft.public.access.modulesdaovba)

Loading