Jump to content

ludo1960

Members
  • Posts

    123
  • Joined

  • Last visited

Everything posted by ludo1960

  1. Hi guys, Yet another rookie question, trying to implement this: I have a function: <?php //MyHelper.php function getnext( $name ) { $conn = DB::table('counter')->where('name', $name )->first(); $result = $conn->findAndModify( ['name' => $name], ['_id' => ['seq' => 1]], ['seq' => true], ['new' => true, 'upsert' => true] ); return $result['seq']; } ?> And I am calling it so: $db_array = getnext(array('name' => 'role_id')); print_r( $db_array); Results in call to a member function on NULL, not sure where I'm going wrong! It is making a connection and the counter table has a 'role_id' in it. Can anyone tell me where I'm going wrong?
  2. For anyone wanting a quick intro into Postgres, this site is easy reading http://www.postgresqltutorial.com
  3. Point taken, this will help in the meantime https://github.com/dimitri/pgloader/releases/tag/v3.4.1 until I suss out postgres. But why is phppgadmin using adodb and not php7.2-pgsql, Can't find anything the config.inc.php that mentions the driver to use?
  4. Hi guys, Thought I would give postgres a go, installed it on debian 9 then installed phppgadmin. When I try to run SQL in phppgadmin: CREATE TABLE `posts` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `author_id` int(10) unsigned NOT NULL , `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `content` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `rate` int(255) COLLATE utf8_unicode_ci NOT NULL, `release_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; I get the following error: Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /usr/share/php/adodb/adodb-error.inc.phpon line 114 Even the SQL does not run, as I get the error: SQL error: ERROR: syntax error at or near "`" LINE 1: CREATE TABLE `posts` ( ^ Am i missing some sort of configuration in postgres or phppgadmin. I should add that I have installed drupal and laravel using the postgres database with no issues whatsoever, so postgres is working. I have got php7-2 installed, so I don't understand why phppgadmin is looking in /usr/share/php. Any ideas guys?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.