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 6767343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:56:24+00:00 2026-05-26T14:56:24+00:00

I am invoking a PHP script from and Android client. Here is the PHP

  • 0

I am invoking a PHP script from and Android client. Here is the PHP script

 <?php
//$user = $_GET['username'];
//$timestamp = $_GET['timestamp'];
//$latitude = $_GET['latitude'];
//$longtitude = $_GET['longtitude'];
//$filename = $_GET['filename'];

$user = "test";
$timestamp = 100;
$latitude = 10;
$longtitude = 10;
$filename = "test.jpg";

$dbname = "sqlite:/".dirname(__FILE__)."/terrapin";
$handle = new PDO($dbname);
if (!$handle) die ($error);

error_log("before exec",0);
$insert = "INSERT INTO information VALUES(NULL,'$user','$latitude','$longtitude','$timestamp','$filename')";
$handle->exec($insert);
error_log("after exec",0);
$handle = null;

$total = $user."\n".$timestamp."\n".$latitude."\n".$longtitude;
$name = "dumpp.txt";
$fh = fopen($name, 'w');
fwrite($fh,$total);
fclose($fh);
?>

The problem is, when I run the script from the command line, it works fine and inserts into the db. But when I remove the comments and get the values from the GET request and invoke the script from the client, nothing gets inserted into the db. There is nothing in the error, however both the error_log statements get printed. Any idea why this is happening?

  • 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-05-26T14:56:25+00:00Added an answer on May 26, 2026 at 2:56 pm

    I think you may have just hit the classic sqlite “Gotcha”.

    If the file you specify on the open statement does not exists sqllite will quietly create a new empty database. This new database will not have the tables your application expects defined inside.

    Have a look in your application directories for an empty sqlite database created in an unexpected location.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP script that I'm invoking from another shell script that sends
I'm trying to write a simple php script to take in data from stdin
I'm using PHP, Oracle and crontab. Crontab is invoking a php script, which is
I am invoking a asynchronous PageMethod call from the client-side. The backend code is
I'm attempting to run an application on the server, invoking it from PHP using
I am invoking camera from my application. i want to remove few menu items
Invoking an extension method that works on a interface from an implementor seems to
When invoking the method push_back from std::vector , its size is incremented by one,
I am invoking PHP cURL method on a server and the response is XML
I'm extremely new to SOAP and I'm trying to implement a quick test client

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.