Re: [sqlite] What is the exact syntax for SELECT MAX in PHP?

2017-08-05 Thread Simon Slavin
On 5 Aug 2017, at 10:10pm, J. King wrote: > Simon, why would you recommend not using PDO? Does the SQLite3 extension > perform better, or does it boil down to personal preference? Good question. Please allow me slight simplification in the following. PHP’s SQLite3

Re: [sqlite] What is the exact syntax for SELECT MAX in PHP?

2017-08-05 Thread J. King
Simon, why would you recommend not using PDO? Does the SQLite3 extension perform better, or does it boil down to personal preference? On August 5, 2017 1:35:43 PM EDT, Simon Slavin wrote: > > >On 5 Aug 2017, at 10:53am, Edmondo Borasio >wrote: >

Re: [sqlite] What is the exact syntax for SELECT MAX in PHP?

2017-08-05 Thread Simon Slavin
On 5 Aug 2017, at 10:53am, Edmondo Borasio wrote: > Hey, do you know where I can find good instructions on how to use SQLITE in > PHP? I used to do that for a living. First, use the sqlite3 module. Don’t use the PDO module which can access many types of database.

Re: [sqlite] implicit transaction is commited without sqlite3_reset or sqlite3_finalize, differs with Documentation, which one is correct ?

2017-08-05 Thread Keith Medcalf
Both. You are stepping a "statement" to the "end" (that is, completion, naught more to do). Thus the statement is automatically reset and any implicit transaction is committed. If however you executed a statement like: SELECT * FROM ReallyBigTable; and ReallyBigTable has 1 million rows

Re: [sqlite] SQLITE_STMT extension

2017-08-05 Thread Bart Smissaert
Ah, OK. I will just keep track then of statement handles in my own code, which is quite simple. RBS On Sat, Aug 5, 2017 at 2:54 PM, Richard Hipp wrote: > On 8/5/17, Bart Smissaert wrote: > > > > SQLite_stmt doesn't hold the statement handle... > >

Re: [sqlite] Suggestion: Pre-release Snapshots versioning

2017-08-05 Thread jose isaias cabrera
Richard Hipp wrote... On 8/4/17, jose isaias cabrera wrote: Right now, when I went to a machine that I had upgraded with a snapshot, I saw that the version was 3.20.0. But when I compared the DLL file size and date, they were different. It would be nice for

Re: [sqlite] LSM1 extension

2017-08-05 Thread Richard Hipp
On 8/5/17, Charles Leifer wrote: > Right -- my question is still unanswered as to why the code was merged in. The code was merged due to bad planning. We thought LSM1 would be ready in time for 3.20.0, but we underestimated the amount of work involved in getting it there,

Re: [sqlite] SQLITE_STMT extension

2017-08-05 Thread Richard Hipp
On 8/5/17, Bart Smissaert wrote: > > SQLite_stmt doesn't hold the statement handle... > I wonder why this is. > Because that would be a "pointer leak". https://sqlite.org/bindptr.html#ptrleak -- D. Richard Hipp d...@sqlite.org

[sqlite] SQLITE PHP syntax issues - INSERT INTO db

2017-08-05 Thread Edmondo Borasio
$ID; echo $ID; //This returns: *string(1) "5"* $NewID = $ID + 1; echo $NewID; //This returns: *6* //If I input the $NewID manually as a string (for example '6', *it works fine* and updates the db correctly) *$query1="INSERT INTO Table"."(ID,name,surname)"."VALUES('6','newName','newSurname');"; *

Re: [sqlite] implicit transaction is commited without sqlite3_reset or sqlite3_finalize, differs with Documentation, which one is correct ?

2017-08-05 Thread Igor Tandetnik
On 8/5/2017 5:44 AM, 倪磊 wrote: I verified this through Linux Perf tools. What does that mean? How do these tools convince you that a transaction was committed? Examine the database before and after, using SQLite command line utility. Does "test" table contain one more row after than it did

[sqlite] SQLITE_STMT extension

2017-08-05 Thread Bart Smissaert
As I understand this the eponymous-only virtual table, sqlite_stmt, will show any active (so not finalized) statements on the current database connection. As mentioned this can be useful to track unfinalized statements and this is what I was interested in. There are 2 problems with this: Firstly a

[sqlite] implicit transaction is commited without sqlite3_reset or sqlite3_finalize, differs with Documentation, which one is correct ?

2017-08-05 Thread 倪磊
Question for the paragraph in http://www.sqlite.org/lang_transaction.html: "An implicit transaction (a transaction that is started automatically, not a transaction started by BEGIN) is committed automatically when the last active statement finishes. A statement finishes when its prepared

Re: [sqlite] What is the exact syntax for SELECT MAX in PHP?

2017-08-05 Thread Edmondo Borasio
Bingo! Many thanks! Hey, do you know where I can find good instructions on how to use SQLITE in PHP? I have searched a lot but haven't found much more than isolated questions from different users on some forum... Regards Edmondo Dr Edmondo Borasio, MedC BQ Ophth, FEBO Consultant

Re: [sqlite] What is the exact syntax for SELECT MAX in PHP?

2017-08-05 Thread Tim Streater
On 5 Aug 2017, at 9:35, Edmondo Borasio wrote: > $results = $db->query("SELECT MAX(ID) FROM Table")->fetchArray(); > $Highest_ID = $results['ID']; > var_dump($Highest_ID); > > I get NULL Try: $results = $db->query("SELECT MAX(ID) as mx FROM

[sqlite] What is the exact syntax for SELECT MAX in PHP?

2017-08-05 Thread Edmondo Borasio
$results = $db->query("SELECT MAX(ID) FROM Table")->fetchArray(); $Highest_ID = $results['ID']; var_dump($Highest_ID); I get NULL Cheers Ed ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org