Sorry about my late reply but this was my function - a bit of a hack but
works properly on my version of php-sqlite3:
function get_primary_key_name($table)
{
$primary_key='';
$db = new MyDB();
if(!$db)
{
echo $db->lastErrorMsg
And then I do a query where the value (argument) matches for a primary key
name. The table name is also an input to make things easier.
On Mon, Oct 10, 2016 at 5:12 PM, Ratin wrote:
> Sorry about my late reply but this was my function - a bit of a hack but
> works properly on my version of php-s
Hi Ratin,
I "think" you can just do this and not have to store the table name.
However, I have no way of testing this. You will have to test on your end.
while ($result = $query->fetchArray()) {
if ($result['pk'] !== null) {
$primary_key=$result['pk'];
}
}
Best,
Trying to build the latest released version, how should I go about doing
it? Currently I installed the php5-sqlite package on ubuntu 14.04 but its a
bit outdated and its not working correctly with the c++ library properly
(can't open the DB while c++ app is running even when both parties opened
the
Hi Karl, Isnt it the same ? I am doing the check if ($result['pk'] == 1),
and you are doing if ($result['pk'] !== null). I wanted to make sure I
dont get false positives, what if $result['pk'] is set to zero, in your
case it will be a match but thats probably not what we want, cuz the pk
field is
You may be correct. Admittedly, I am stabbing in the dark here. I work on
MySQL, not SQLite.
Just good at key word searches. :) This link seems to be promising.
http://www.sqlite.org/c3ref/table_column_metadata.html
Sorry I can't help more.
Best,
Karl DeSaulniers
Design Drumm
http://designdru