473,386 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Can not insert data into SQLite3 database

Can not insert data into SQLite3 database through browser however i
can easily insert data into my db from konsole, in both attmpts i used
php 5.2.6 on 2.6.25.* linux kernel

i think there is a problem with my php setup but i could not find
it...

here is the code;
----------------------------------------------------------------------------------------
$db = new PDO("sqlite:bar.db");
$sql = "select * from user";

$query = "insert into user values(null,'foo','bar')";
$db->query($query);
print_r($db->query($query));
print_r($db->query($sql));

foreach ($db->query($sql) as $row)
print $row['id'] . " " . $row['text'] . " " . $row['text2'] .
"<br>";

unset($db);
------------------------------------------------------------------------------------------

first print_r() function prints nothing, actually "select" works,
"insert" wouldn't....

What's the problem?
Aug 30 '08 #1
8 6594
Betikci Boris wrote:
Can not insert data into SQLite3 database through browser however i
can easily insert data into my db from konsole, in both attmpts i used
php 5.2.6 on 2.6.25.* linux kernel

i think there is a problem with my php setup but i could not find
it...

here is the code;
----------------------------------------------------------------------------------------
$db = new PDO("sqlite:bar.db");
$sql = "select * from user";

$query = "insert into user values(null,'foo','bar')";
$db->query($query);
print_r($db->query($query));
print_r($db->query($sql));

foreach ($db->query($sql) as $row)
print $row['id'] . " " . $row['text'] . " " . $row['text2'] .
"<br>";

unset($db);
------------------------------------------------------------------------------------------

first print_r() function prints nothing, actually "select" works,
"insert" wouldn't....

What's the problem?
Enable all errors and display them - in your php.ini file, ensure you have:

display_error=on
error_reporting=E_ALL
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Aug 30 '08 #2
On Aug 30, 4:38*pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Betikci Boris wrote:
Can not insert data into SQLite3 database through browser however i
can easily insert data into my db from konsole, in both attmpts i used
php 5.2.6 on 2.6.25.* linux kernel
i think there is a problem with my php setup but i could not find
it...
here is the code;
----------------------------------------------------------------------------------------
$db = new PDO("sqlite:bar.db");
$sql = "select * from user";
$query = "insert into user values(null,'foo','bar')";
$db->query($query);
print_r($db->query($query));
print_r($db->query($sql));
*foreach ($db->query($sql) as $row)
* * print $row['id'] . " " . $row['text'] . " " . $row['text2'] .
"<br>";
unset($db);
------------------------------------------------------------------------------------------
first print_r() function prints nothing, actually "select" works,
"insert" wouldn't....
What's the problem?

Enable all errors and display them - in your php.ini file, ensure you have:

display_error=on
error_reporting=E_ALL

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
i've tried with try catch but that's the point there is nothing to
report.. According to this function =print_r($db->query($query));
query returns 0 or even -1,

I think the problem with mod_php configuration on cli with php
everything works fine ...
Aug 30 '08 #3
Betikci Boris wrote:
On Aug 30, 4:38 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>Betikci Boris wrote:
>>Can not insert data into SQLite3 database through browser however i
can easily insert data into my db from konsole, in both attmpts i used
php 5.2.6 on 2.6.25.* linux kernel
i think there is a problem with my php setup but i could not find
it...
here is the code;
----------------------------------------------------------------------------------------
$db = new PDO("sqlite:bar.db");
$sql = "select * from user";
$query = "insert into user values(null,'foo','bar')";
$db->query($query);
print_r($db->query($query));
print_r($db->query($sql));
foreach ($db->query($sql) as $row)
print $row['id'] . " " . $row['text'] . " " . $row['text2'] .
"<br>";
unset($db);
------------------------------------------------------------------------------------------
first print_r() function prints nothing, actually "select" works,
"insert" wouldn't....
What's the problem?
Enable all errors and display them - in your php.ini file, ensure you have:

display_error=on
error_reporting=E_ALL

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================

i've tried with try catch but that's the point there is nothing to
report.. According to this function =print_r($db->query($query));
query returns 0 or even -1,

I think the problem with mod_php configuration on cli with php
everything works fine ...
I didn't say use try and catch. Please try what I wrote.

PHP base code doesn't generally throw exceptions. But it does provide
error information if you have it configured to do so.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Aug 31 '08 #4
On Aug 31, 4:10*am, Jerry Stuckle <jstuck...@attglobal.netwrote:
Betikci Boris wrote:
On Aug 30, 4:38 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Betikci Boris wrote:
Can not insert data into SQLite3 database through browser however i
can easily insert data into my db from konsole, in both attmpts i used
php 5.2.6 on 2.6.25.* linux kernel
i think there is a problem with my php setup but i could not find
it...
here is the code;
----------------------------------------------------------------------------------------
$db = new PDO("sqlite:bar.db");
$sql = "select * from user";
$query = "insert into user values(null,'foo','bar')";
$db->query($query);
print_r($db->query($query));
print_r($db->query($sql));
*foreach ($db->query($sql) as $row)
* * print $row['id'] . " " . $row['text'] . " " . $row['text2'] .
"<br>";
unset($db);
------------------------------------------------------------------------------------------
first print_r() function prints nothing, actually "select" works,
"insert" wouldn't....
What's the problem?
Enable all errors and display them - in your php.ini file, ensure you have:
display_error=on
error_reporting=E_ALL
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
i've tried with try catch but that's the point there is nothing *to
report.. *According to this function =print_r($db->query($query));
query returns 0 or even -1,
I think the problem with mod_php configuration on cli with php
everything works fine ...

I didn't say use try and catch. *Please try what I wrote.

PHP base code doesn't generally throw exceptions. *But it does provide
error information if you have it configured to do so.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
In php.ini;

display_error=on
error_reporting=E_ALL & ~E_NOTICE
Aug 31 '08 #5
Betikci Boris wrote:
On Aug 31, 4:10 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
>Betikci Boris wrote:
>>On Aug 30, 4:38 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Betikci Boris wrote:
Can not insert data into SQLite3 database through browser however i
can easily insert data into my db from konsole, in both attmpts i used
php 5.2.6 on 2.6.25.* linux kernel
i think there is a problem with my php setup but i could not find
it...
here is the code;
----------------------------------------------------------------------------------------
$db = new PDO("sqlite:bar.db");
$sql = "select * from user";
$query = "insert into user values(null,'foo','bar')";
$db->query($query);
print_r($db->query($query));
print_r($db->query($sql));
foreach ($db->query($sql) as $row)
print $row['id'] . " " . $row['text'] . " " . $row['text2'] .
"<br>";
unset($db);
------------------------------------------------------------------------------------------
first print_r() function prints nothing, actually "select" works,
"insert" wouldn't....
What's the problem?
Enable all errors and display them - in your php.ini file, ensure you have:
display_error=on
error_reporting=E_ALL
i've tried with try catch but that's the point there is nothing to
report.. According to this function =print_r($db->query($query));
query returns 0 or even -1,
I think the problem with mod_php configuration on cli with php
everything works fine ...
I didn't say use try and catch. Please try what I wrote.

PHP base code doesn't generally throw exceptions. But it does provide
error information if you have it configured to do so.

In php.ini;

display_error=on
error_reporting=E_ALL & ~E_NOTICE
That still isn't what I asked you to put in your php.ini file!

Do you always have this much trouble following a simple request?

Sorry, I'm not in the habit of wasting my time. Find someone else to
help you.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Aug 31 '08 #6
On Aug 31, 5:04*pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Betikci Boris wrote:
On Aug 31, 4:10 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
Betikci Boris wrote:
On Aug 30, 4:38 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Betikci Boris wrote:
Can not insert data into SQLite3 database through browser however i
can easily insert data into my db from konsole, in both attmpts i used
php 5.2.6 on 2.6.25.* linux kernel
i think there is a problem with my php setup but i could not find
it...
here is the code;
----------------------------------------------------------------------------------------
$db = new PDO("sqlite:bar.db");
$sql = "select * from user";
$query = "insert into user values(null,'foo','bar')";
$db->query($query);
print_r($db->query($query));
print_r($db->query($sql));
*foreach ($db->query($sql) as $row)
* * print $row['id'] . " " . $row['text'] . " " . $row['text2']
Sep 1 '08 #7
On Sep 1, 12:08*pm, Betikci Boris <pard...@gmail.comwrote:
On Aug 31, 5:04*pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Betikci Boris wrote:
On Aug 31, 4:10 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
>Betikci Boris wrote:
>>On Aug 30, 4:38 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>>>Betikci Boris wrote:
>>>>Can not insert data intoSQLite3database through browser however i
>>>>can easily insert data into my db from konsole, in both attmpts iused
>>>>php 5.2.6 on 2.6.25.* linux kernel
>>>>i think there is a problem with my php setup but i could not find
>>>>it...
>>>>here is the code;
>>>>----------------------------------------------------------------------------------------
>>>>$db = new PDO("sqlite:bar.db");
>>>>$sql = "select * from user";
>>>>$query = "insert into user values(null,'foo','bar')";
>>>>$db->query($query);
>>>>print_r($db->query($query));
>>>>print_r($db->query($sql));
>>>>*foreach ($db->query($sql) as $row)
>>>>* * print $row['id'] . " " . $row['text'] . " " . $row['text2'] .
>>>>"<br>";
>>>>unset($db);
>>>>------------------------------------------------------------------------------------------
>>>>first print_r() function prints nothing, actually "select" works,
>>>>"insert" wouldn't....
>>>>What's the problem?
>>>Enable all errors and display them - in your php.ini file, ensure you have:
>>>display_error=on
>>>error_reporting=E_ALL
>>i've tried with try catch but that's the point there is nothing *to
>>report.. *According to this function =print_r($db->query($query));
>>query returns 0 or even -1,
>>I think the problem with mod_php configuration on cli with php
>>everything works fine ...
>I didn't say use try and catch. *Please try what I wrote.
>PHP base code doesn't generally throw exceptions. *But it does provide
>error information if you have it configured to do so.
In php.ini;
display_error=on
error_reporting=E_ALL & ~E_NOTICE
That still isn't what I asked you to put in your php.ini file!
Do you always have this much trouble following a simple request?
Sorry, I'm not in the habit of wasting my time. *Find someone else to
help you.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================

.. and also;

display_error=on
error_reporting=E_ALL

prints nothing.. *what a strange mod_php malfunction..
Oh! what a shame!
Directory permissions, which is the database located, must allow to
write!...
chmod 777 todir has been removed all problems;)
Sep 3 '08 #8
Betikci Boris wrote:
On Sep 1, 12:08 pm, Betikci Boris <pard...@gmail.comwrote:
>On Aug 31, 5:04 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>>Betikci Boris wrote:
On Aug 31, 4:10 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
Betikci Boris wrote:
>On Aug 30, 4:38 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>>Betikci Boris wrote:
>>>Can not insert data intoSQLite3database through browser however i
>>>can easily insert data into my db from konsole, in both attmpts i used
>>>php 5.2.6 on 2.6.25.* linux kernel
>>>i think there is a problem with my php setup but i could not find
>>>it...
>>>here is the code;
>>>----------------------------------------------------------------------------------------
>>>$db = new PDO("sqlite:bar.db");
>>>$sql = "select * from user";
>>>$query = "insert into user values(null,'foo','bar')";
>>>$db->query($query);
>>>print_r($db->query($query));
>>>print_r($db->query($sql));
>>> foreach ($db->query($sql) as $row)
>>> print $row['id'] . " " . $row['text'] . " " . $row['text2'] .
>>>"<br>";
>>>unset($db);
>>>------------------------------------------------------------------------------------------
>>>first print_r() function prints nothing, actually "select" works,
>>>"insert" wouldn't....
>>>What's the problem?
>>Enable all errors and display them - in your php.ini file, ensure you have:
>>display_error=on
>>error_reporting=E_ALL
>i've tried with try catch but that's the point there is nothing to
>report.. According to this function =print_r($db->query($query));
>query returns 0 or even -1,
>I think the problem with mod_php configuration on cli with php
>everything works fine ...
I didn't say use try and catch. Please try what I wrote.
PHP base code doesn't generally throw exceptions. But it does provide
error information if you have it configured to do so.
In php.ini;
display_error=on
error_reporting=E_ALL & ~E_NOTICE
That still isn't what I asked you to put in your php.ini file!
Do you always have this much trouble following a simple request?
Sorry, I'm not in the habit of wasting my time. Find someone else to
help you.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
.. and also;

display_error=on
error_reporting=E_ALL

prints nothing.. what a strange mod_php malfunction..

Oh! what a shame!
Directory permissions, which is the database located, must allow to
write!...
chmod 777 todir has been removed all problems;)
Which, would have been indicated by an E_NOTICE message if you would
have followed my initial instructions. You probably changed the wrong
php.ini file.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Sep 3 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: lolmcbride | last post by:
Hi, is it possible to pass args through the api which are the same as the args you can use on the sqlite3 command line? What I'm talking about is the .mode or .output commands which you can enter...
2
by: Josh | last post by:
Hi, I'm running into a problem when trying to create a view in my sqlite database in python. I think its a bug in the sqlite3 api that comes with python 2.5. This works as expected: conn =...
1
by: Nader Emami | last post by:
L.S., I have to compile (install) locally Python 2.5, because I don't have 'root' permission. Besides I would use 'sqlite3' as a database for TurboGears/Django. I have installed 'sqlite3'...
4
by: Simon | last post by:
I installed the source code on unix for python 2.5.1. The install went mainly okay, except for some failures regarding: _ssl, _hashlib, _curses, _curses_panel. No errors regarding sqlite3....
2
by: =?ISO-8859-1?Q?S=E9bastien_Ramage?= | last post by:
Hi ! I'm trying to build an client/server app based on Pyro and sqlite3. But I have a problem using sqlite3 on the server I got this error : sqlite3.ProgrammingError: ('SQLite objects...
12
by: John | last post by:
Hi, I'm trying to connect to a SQLite3 database for days now but I'm stuck. PHP returns an error that I made a "call to undefined function sqlite_open(). In the php.ini the extension=php_pdo.dll...
1
by: jeff_d_harper | last post by:
I've run into a problem with text encoding in the Sqlite3 module. I think it may be a bug. By default sqlite3 converts strings in the database from UTF-8 to unicode. This conversion can be...
15
by: Kurda Yon | last post by:
Hi, I try to "build" and "install" pysqlite? After I type "python setup.py build" I get a lot of error messages? The first error is "src/ connection.h:33:21: error: sqlite3.h: No such file or...
0
by: klia | last post by:
hello everyone How can i be able to prompt users to query their search about photos Date in which date formate is "2008:12:10". by the way the following codes are hardcoded. import os import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.