Jump to content
TNG Community

TNGApi Install Problem


lesdelc

Recommended Posts

I keep getting this message after trying to complete an install of TngApi-3.2.2.ZIP: Cannot execute query: SELECT * FROM tng_users WHERE username='Sysop'. This message took down my website. The only way I could log back in was to go cpanel and use File Manager and locate the plugin and delete it from WordPress. I would like to try TgApi with TNG & WordPress but I cannot solve this problem message without taking down my website.

I have complied with TNG being installed and met all of the requirements.

Link to comment
Share on other sites

Sorry to note you are having problems installing TngApi.

It looks like the plugin cannot find the TNG folder.
You have probably done ths but I ask any way.
Please check that 'TNG Path' is set correctly in

wp-admin  dashboard>settings>TngApi. The path should be Root Path as set in TNG Admin>Setup.

I would be interested to know how you get-on

 

 

 

Link to comment
Share on other sites

Sorry for the late response. I noticed the date of the latest release was 2016. I thought development stopped on the plugin and removed it. Yes, the TNG path is set up correctly. I could not progress any further with the install. Is the plugin still being developed?

 

Link to comment
Share on other sites

I have not updated the plugin as I am content with what it does and I have not progressed beyond TNG V10.1.3.

I have not had any issues reported so there are no changes. So I am doing a lot of thinking, here, to remember what would cause this issue!

The error message is generated

  1. if actual Root Path to TNG is not correct. Path is set in TNG setup and is of the form ( /public_html/tng/)
  2. if the plugin cannot find config.php in the TNG root directory.
  3. if it cannot find Wordpress user name in the TNG database. So it would expect username='Sysop' in wordpress and tng.

Sorry, pretty basic.

See if I can think of something tomorrow.

BTW could you let me know TNG and PHP version?

 

 

 

Link to comment
Share on other sites

5 hours ago, lesdelc said:

Is the plugin still being developed?

You need to be specific with which plugin you're talking about - you have another posting which I assumed was about the TNG-WordPress-plugin, which is not the same thing as Mahesh's TngApi plugin.

Are you asking about each of them in two different places, or about the same one in two different places?

Roger

Link to comment
Share on other sites

17 hours ago, mahesh said:

I have not updated the plugin as I am content with what it does and I have not progressed beyond TNG V10.1.3.

I have not had any issues reported so there are no changes. So I am doing a lot of thinking, here, to remember what would cause this issue!

The error message is generated

  1. if actual Root Path to TNG is not correct. Path is set in TNG setup and is of the form ( /public_html/tng/)
  2. if the plugin cannot find config.php in the TNG root directory.
  3. if it cannot find Wordpress user name in the TNG database. So it would expect username='Sysop' in wordpress and tng.

Sorry, pretty basic.

See if I can think of something tomorrow.

BTW could you let me know TNG and PHP version?

 

 

 

The basic config is correct. After I posted my first message to you I now have  TNG 12.1 running in WordPress with the TNG plugin from Mark Barnes. I need some work on the menus but it is functional.

I am using TNG 12.1 AND PHP 7.2.14

Link to comment
Share on other sites

13 hours ago, theKiwi said:

You need to be specific with which plugin you're talking about - you have another posting which I assumed was about the TNG-WordPress-plugin, which is not the same thing as Mahesh's TngApi plugin.

Are you asking about each of them in two different places, or about the same one in two different places?

Roger

If you take a look at the first message I posted here the title refers to TNGApi. All messages here refer to TNGApi. The other message you mention is the TNG plugin from Mark Barnes which is posted under a different message title.

Link to comment
Share on other sites

1 hour ago, lesdelc said:

The basic config is correct. After I posted my first message to you I now have  TNG 12.1 running in WordPress with the TNG plugin from Mark Barnes. I need some work on the menus but it is functional.

I am using TNG 12.1 AND PHP 7.2.14

TngApi path-requirements are very similar to TNG plugin. So it should work. I have just tested it on  local WAMP server with PHP V7.0.10 and it works. I try and get v7.2.14, tomorrow. Only thing I cannot test is the TNG V12. I do not see how that would give you the error.

Are testing on local server?

Link to comment
Share on other sites

7 hours ago, mahesh said:

TngApi path-requirements are very similar to TNG plugin. So it should work. I have just tested it on  local WAMP server with PHP V7.0.10 and it works. I try and get v7.2.14, tomorrow. Only thing I cannot test is the TNG V12. I do not see how that would give you the error.

Are testing on local server?

I am testing on my live website. I attempted the install again and got the same message as follows:

Installing Plugin from uploaded file: TngApi-3.2.2.zip

Unpacking the package…

Installing the plugin…

Plugin installed successfully.

Activate Plugin Return to Plugin Installer  --------> when I attempt to Activate the plugin I get the following message

Cannot execute query: SELECT * FROM tng_users WHERE username='Sysop'

I had to use File Manager again to enter the website files and delete the plugin before I get back into my website. Again, TNG is working fine.

Link to comment
Share on other sites

On 4/2/2019 at 2:07 AM, lesdelc said:

I am testing on my live website. I attempted the install again and got the same message as follows:

Installing Plugin from uploaded file: TngApi-3.2.2.zip

Unpacking the package…

Installing the plugin…

Plugin installed successfully.

Activate Plugin Return to Plugin Installer  --------> when I attempt to Activate the plugin I get the following message

Cannot execute query: SELECT * FROM tng_users WHERE username='Sysop'

I had to use File Manager again to enter the website files and delete the plugin before I get back into my website. Again, TNG is working fine.

Sorry for late response.

It is nearly 3 years since we updated this plugin. I have gone thro' the code to refresh my memory. There is only one instance where an error is treated as fatal error. In hindsight, this should have been treated more gently by my son - He wrote the plugin.

I see that you are quite comfortable analysing the code. If and when you feel adventurous, you may want to look at this bit of code in /Upavadi/TngContent.php

$tng_user_name = $this->getTngUserName();
        $query = "SELECT * FROM {$this->tables['users_table']} WHERE username='{$tng_user_name}'";
        $result = mysqli_query($db, $query) or die("Cannot execute query: $query " . mysqli_error($db));
        $row = $result->fetch_assoc();

        $this->currentPerson = $row['personID'];
        return $this;
    }

Error: Cannot execute query: SELECT * FROM tng_users WHERE username='Sysop' ,

suggests that the plugin has found the TNG table, tng_users in the database, but cannot find the logged in user ( user_login  in table wp_usersin  WP database) matching username.

The plugin does not interact with TNG installation apart from accessing config.php file in TNG root.

It seems that for some reason user_login  and  username.

If you ever want to try again, may try with a differet user name.

I have the plugin working comfortably with TNG Plugin  on my Main Web site and with Kloosterman method on my test site.

On both sites, Wordpress and TNG have their own folders and databases.

Sorry I have not been much help.

 

 

 

 

Link to comment
Share on other sites

5 hours ago, mahesh said:

Sorry for late response.

It is nearly 3 years since we updated this plugin. I have gone thro' the code to refresh my memory. There is only one instance where an error is treated as fatal error. In hindsight, this should have been treated more gently by my son - He wrote the plugin.

I see that you are quite comfortable analysing the code. If and when you feel adventurous, you may want to look at this bit of code in /Upavadi/TngContent.php


$tng_user_name = $this->getTngUserName();
        $query = "SELECT * FROM {$this->tables['users_table']} WHERE username='{$tng_user_name}'";
        $result = mysqli_query($db, $query) or die("Cannot execute query: $query " . mysqli_error($db));
        $row = $result->fetch_assoc();

        $this->currentPerson = $row['personID'];
        return $this;
    }

Error: Cannot execute query: SELECT * FROM tng_users WHERE username='Sysop' ,

suggests that the plugin has found the TNG table, tng_users in the database, but cannot find the logged in user ( user_login  in table wp_usersin  WP database) matching username.

The plugin does not interact with TNG installation apart from accessing config.php file in TNG root.

It seems that for some reason user_login  and  username.

If you ever want to try again, may try with a differet user name.

I have the plugin working comfortably with TNG Plugin  on my Main Web site and with Kloosterman method on my test site.

On both sites, Wordpress and TNG have their own folders and databases.

Sorry I have not been much help.

 

I could not figure out where your plugin was pulling the username from & checked my database & could see no additions to the database. You answered that question for me that your plugin does not add to the database but uses what is already there. Since receiving this message I have made progression with WordPress and the TNG plugin. I have been a user of TNG for many years as a stand alone website. I wanted to blog and add TNG which has been great with the help of those from the TNG forums.

I viewed your website and test site & liked what I saw. It is a clean setup. I will keep you in mind if I should decide to try the plugin again. Thanks for the help.

 

 

6

 

Link to comment
Share on other sites

3 hours ago, mahesh said:

Thanks.  Do let me know if you do decide to try the plugin in future.

Mahesh, I will let you know. Best of luck with further developments.

-Lesdelc-

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...