Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Logic Error or missing database

Status
Not open for further replies.

adhakal

Programmer
Jun 26, 2003
2
US
Hi all,

So this is the deal.

I am running some php pages on a sqlite database. The folder where all the php files reside and the database both have been chmod'ed to 666. I can get the php to read(select) off of the database, but whenever I try writing(insert) to the database using sqlite_query() it says:

SQL logic error or missing database

I am a newbee with php and sqlite. Your help will be greatly appreciated.
 
Let's see the query string, that will help us to help you.
 
Heres the query

sqlite_query("insert into table1 values ('$_POST[value1]','$_POST[value2]'", $link) or fail();

function fail ( )
{
die("Query failed: " . sqlite_error_string(sqlite_last_error($link)));
}
 
You are missing a closing parenthese:
Code:
sqlite_query("insert into table1 values ('$_POST[value1]','$_POST[value2]'[red])[/red]", $link) or fail();

--Chessbot

There is a level of Hell reserved for probability theorists in which every monkey that types on a typewriter produces a Shakespearean sonnet.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top