bbAntiSpam: Discuss how to stop web spam

The forum is retired.

bbAntiSpam Forum Index - Textual Confirmation - FAQ: executing SQL

Author Message
admin
Site Admin


Joined: 18 Apr 2006
Posts: 805
Location: Saint-Petersburg, Russia

Posted: Thu Nov 16, 2006 6:47 am    Post subject: FAQ: executing SQL  

The hardest point of installing Textual Confirmation is running SQL queries. Unless you are a computer-friendly person, it's a non-trivial task. Now it's made easy: use db_update.php .

If you have no idea what to do with the "[SQL]" part, don't worry. Instead, execute the following step-by-step instructions:

* Complete all the steps before the "[SQL]" part, especially changing includes/constants.php.
* Download db_update.zip
* Unpack "db_update.zip" to get "db_update.php"
* Upload "db_update.php" to the root folder of your forum
* Run "db_update.php" in your browser. For example, if you forum address is "http://mysite.com/phpBB2/", then you should point your browser to "http://mysite.com/phpBB2/db_update.php".
* Login as the forum admin. The script "db_update.php" will update the database and report the success.
* Delete "db_update.php".


Last edited by admin on Thu Mar 15, 2007 3:06 am; edited 5 times in total
admin
Site Admin


Joined: 18 Apr 2006
Posts: 805
Location: Saint-Petersburg, Russia

Posted: Mon Dec 25, 2006 6:50 am    Post subject:  

If you use phpBB with PostgreSQL or MS-SQL, then SQL for creating the table should be a bit different. According to the wonderful EasyMOD :: SQL Parser, the SQL syntax is following.

PostgreSQL:
Code:

CREATE TABLE phpbb_textual_confirmation (
    id SERIAL,
    question TEXT NOT NULL,
    answers TEXT NOT NULL,
    CONSTRAINT phpbb_textual_confirmation_pk PRIMARY KEY (id)
);


MS-SQL:
Code:

CREATE TABLE phpbb_textual_confirmation (
    id INTEGER NOT NULL IDENTITY(1, 1),
    question TEXT NOT NULL,
    answers TEXT NOT NULL,
    CONSTRAINT phpbb_textual_confirmation_pk PRIMARY KEY (id) ON [PRIMARY]
)  ON [PRIMARY] TEXTIMAGE_ON [PRIMARY];
Bassmint



Joined: 17 Feb 2008
Posts: 2

Posted: Sun Feb 17, 2008 2:27 am    Post subject: SQL Error  

I have tried the db_update.php file. It seemed to install without errors. However, I get the following SQL error when I try to provide the Q&A on the admin page:

SQL Error : 1146 Table 'mywebsite.TEXTUAL_CONFIRMATION_TABLE' doesn't exist
INSERT INTO TEXTUAL_CONFIRMATION_TABLE(question,answers) VALUES('Who is buried in Grant''s tomb?','Grant grant GRANT')
Line : 113
File : admin_tc.php

It looks like it does not find the table. Any suggestions?

Thanks!
Bassmint
admin
Site Admin


Joined: 18 Apr 2006
Posts: 805
Location: Saint-Petersburg, Russia

Posted: Mon Feb 18, 2008 6:18 am    Post subject:  

Most likely, the file "includes/constants.php" was not changed as described in "install.txt". Please check.
_________________
Oleg Parashchenko, bbAntiSpam
Do you love our tools? Please sponsor further development!
Bassmint



Joined: 17 Feb 2008
Posts: 2

Posted: Mon Feb 18, 2008 10:16 pm    Post subject:  

You were correct.

I made the changes in the file, but forgot to save it. Shocked

The confirmation is now working like a charm! Very Happy

Thanks for your help,
Bassmint
admin
Site Admin


Joined: 18 Apr 2006
Posts: 805
Location: Saint-Petersburg, Russia

Posted: Tue Feb 19, 2008 3:15 am    Post subject:  

Nice! I'm happy to hear it.
_________________
Oleg Parashchenko, bbAntiSpam
Do you love our tools? Please sponsor further development!
Guest






Posted: Tue Sep 02, 2008 5:40 am    Post subject:  

Installed everything, ran the db_update.
and got this


CREATE TABLE phpbb_textual_confirmation ( id INTEGER NOT NULL AUTO_INCREMENT, question TEXT NOT NULL, answers TEXT NOT NULL, PRIMARY KEY (id) )
+++ Error: Access denied for user 'yscr_bbis5X'@'localhost' to database 'phpbb_1'

INSERT INTO phpbb_textual_confirmation(question,answers) VALUES ('Are you human?', 'yes ja oui')
+++ Error: Table 'phpbb_1.phpbb_textual_confirmation' doesn't exist

INSERT INTO phpbb_textual_confirmation(question,answers) VALUES ('Say hello', 'hello hi hallo')
+++ Error: Table 'phpbb_1.phpbb_textual_confirmation' doesn't exist



Now my admin links on the side point to the main forum index.
admin
Site Admin


Joined: 18 Apr 2006
Posts: 805
Location: Saint-Petersburg, Russia

Posted: Wed Sep 03, 2008 3:46 am    Post subject:  

Quote:
+++ Error: Access denied for user 'yscr_bbis5X'@'localhost' to database 'phpbb_1'

It means you can't create new tables from PHP. You have to use some other way (and I don't know which).

Quote:
Now my admin links on the side point to the main forum index.

I hardly can imagine how installing Textual Confirmaion could lead to such problem. Try restoring all the files as they were before installing TC.

Instead of Textual Confirmation, try Advanced Textual Confirmation (you saw it in action on this forum). Details: http://bbantispam.com/forum/viewtopic.php?t=378.
_________________
Oleg Parashchenko, bbAntiSpam
Do you love our tools? Please sponsor further development!
dbtkenyy



Joined: 30 Nov 2008
Posts: 2

Posted: Sun Nov 30, 2008 1:50 pm    Post subject:  

Hi I am trying to install textual confirmation I understand the install until we get the SQL bit where I am lost I know I cannot run db_update.php as my web host stop you from running web based scripts I have to do it all from the control panel. I have full access to the SQL database using PHPMYADMIN. I can get to the database and fine a line that say “create new table on database….” I have the areas of name and number of fileds. Now what do I do?
admin
Site Admin


Joined: 18 Apr 2006
Posts: 805
Location: Saint-Petersburg, Russia

Posted: Mon Dec 01, 2008 4:22 am    Post subject:  

Quote:
as my web host stop you from running web based scripts

In this case, the best idea is:

Ask your web host support to install Textual Confirmation for you.
_________________
Oleg Parashchenko, bbAntiSpam
Do you love our tools? Please sponsor further development!
dbtkenyy



Joined: 30 Nov 2008
Posts: 2

Posted: Mon Dec 01, 2008 8:07 am    Post subject:  

Not at $70 a pop I will not.
I understand all of it but the SQL, I have done a bit of it before but that was a just copy and past this. Which worked well for me. Let see I running MySQL and phpMyAdmin
All I think I need is the code line I need to put “ like the ones you have up PostgreSQL” and the place I put it in. I think that is under “create new table on database” after I have open the database up in phpMyAdmin. The script will run when it is installed. I have to install all scripts from the control panel. My host does not allow web bowers install like db_update.php.
Can you help me please.
admin
Site Admin


Joined: 18 Apr 2006
Posts: 805
Location: Saint-Petersburg, Russia

Posted: Tue Dec 02, 2008 4:53 am    Post subject:  

Well, the SQL requests to create the database table and fill it are:
Code:

CREATE TABLE phpbb_textual_confirmation (
 id       INTEGER NOT NULL AUTO_INCREMENT,
 question TEXT    NOT NULL,
 answers  TEXT    NOT NULL,
 PRIMARY KEY (id)
);
INSERT INTO phpbb_textual_confirmation(question,answers) VALUES ('Are you human?', 'yes\nja\noui');
INSERT INTO phpbb_textual_confirmation(question,answers) VALUES ('Say hello', 'hello\nhi\nhallo');

However, I don't know how to execute this code using phpMyAdmin.

Note also you might need the change the prefix "phpbb_" to the actual prefix used by phpBB.
_________________
Oleg Parashchenko, bbAntiSpam
Do you love our tools? Please sponsor further development!

Ok.