How to run SQL queries

Frequently asked questions about mySQL and other databases.

Moderator: Moderators

How to run SQL queries

Postby DooBDee on Tue Sep 13, 2005 3:42 pm

Problem / Question: I get this action inside the install file for x mod:
Code: Select all
#-----[ SQL ]------------------------------------------

ALTER TABLE `phpbb_forums` ADD forum_parent INT NOT NULL DEFAULT '0';
What do i do?

Answer: There are two ways of handling this. The first way for more advanced users is to go into phpmyadmin and manually type the querie in and execute it.

The more basic way of doing this is by going to this page - sql.php and pasting your code there. after entering the SQL querie, it will generate file named sql.php. Now, just simply upload sql.php to your forum root and run it ONCE. Delete it INSTANTLY after you have run it in your browser.

Problem / Question: I get error which looks like
Code: Select all
Couldn't get list of forums


SQL Error : 1054 Unknown column 'forum_parent' in 'where clause'

SELECT forum_id, cat_id, forum_name FROM phpbb_forums WHERE forum_parent = '0' ORDER BY forum_order ASC

Line : 189
File : admin_forums.php

Answer: This is becuase you have forgotten to run the SQL querie that came with the mod. Usually it is at the top of the install file of the package. To run the SQL command, see the above solution.

Note - these are mod specific SQL errors, the SQL querie itself may differ.
Website Ninja
User avatar
Posts: 3530
Joined: Tue Mar 01, 2005 6:28 pm

Return to Database FAQ

Who is online

Users browsing this forum: No registered users and 1 guest