Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8981339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:18:42+00:00 2026-06-15T20:18:42+00:00

I would like to fetch an Oracle 10g table to JSON in PHP in

  • 0

I would like to fetch an Oracle 10g table to JSON in PHP in order to sparse it in GMap APIv3. So far I can fetch the first line of the Oracle table but I dont know how to do it for all.

I use this so far:

$conn = oci_connect($user, $pass, $host);

$sql  = oci_parse($conn, "select * from POINTS_CS_FRANCO WHERE CODE_CS = '711'");

oci_execute($sql);

class User {
    public $Code_CES = "";
    public $Nbr_Electeur = "";
    public $lat = "";
    public $lng = "";
}

while ($row = oci_fetch_assoc($sql)){
    $user = new User();
    $user->Code_CES = $row['CODE_CES'];
    $user->Nbr_Electeur = $row['NBR_ELECTEUR'];
    $user->lat = $row['LATITUDE'];
    $user->lng = $row['LONGITUDE'];
} 

echo json_encode($user);

?> 

// Returns: {"Code_CES":"CES 000","Nbr_Electeur":"8","lat":"48.834997","lng":"-67.530141"}

Then im not sure if the JSON output would be well-strutured like this to sparse in GMap if it would be complete.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T20:18:43+00:00Added an answer on June 15, 2026 at 8:18 pm

    This works good:

    <?php
    
    $conn = oci_connect($user, $pass, $host);
    
    $sql  = oci_parse($conn, "select * from POINTS_CS_FRANCO WHERE CODE_CS = '711'");
    
    oci_execute($sql);
    
    $rows = array();
    while($r = oci_fetch_assoc($sql)) {
        $rows[] = $r;
    }
    
    $locations =(json_encode($rows));
    
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i would like to fetch data from table a,b,c but order by most recent
I would like to fetch a html page with post method. First I use
In Oracle I can do something like this to fetch a bunch of keys.
I would like to fetch an array in MySQL. Can someone please tell me
I have pdf designed letter. Now using php I would like to fetch the
I would like to fetch the result set from a function for each row
My Flash movie would like communicate with MySQL server to fetch and save data
I would like to fetch images (~250Kb) from another site and save them to
I would like to fetch a number of records from a database to fill
I'm developing a Python 2.6 package in which I would like to fetch a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.