Quantcast

Maximum PC

It is currently Mon Jul 21, 2014 11:49 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Debugging beehive - help needed in MySQL and PHP
PostPosted: Tue Mar 29, 2005 9:38 pm 
Smithfield
Smithfield
User avatar

Joined: Sun Sep 05, 2004 9:01 am
Posts: 8091
Lemme get this out first, thats what the guys on the mysql IRC channel told me, that the bugs were in beehive, so im gonna go with them.

I've been trying to get a beehive forum running out of boredom. So far things have been going alright. I managed to get Apache 2 running and PHP installed without much trouble. MySQL was a bit more problematic but I think ive got it down. Paired with MySQLAdministrator I think i've got basic accounts and permissions down And with the help of PHPMyAdmin for MySQL I think i've got database creation/management down.

Now comes the problem: When running the install php script for beehive I get errors.

At first it said "Must support FULLTEXT etc" which I was told can't be handled by the default engine the windows version of SQL uses, and that I needed to make sure the tables were MyISAM. So I rummaged through the new-install.php file and changed all the table create lines as follows.

Code:
$sql = "CREATE TABLE {$forum_webtag}_ADMIN_LOG (";

Would become:
Code:
$sql = "CREATE TABLE ENGINE=MyISAM {$forum_webtag}_ADMIN_LOG (";

Heres the modified version. Unfortunately that just opened up a whole new can of worms. After making the changes I got this error log.
(Yes I wiped the database between attempts).

Any ideas? I was told the bugs were in the beehive software. So (based on the error logs last message) I opened up \include\db.inc.php and found the offending segment (that seems to be the cause of at least some of the error log).

Code:
function db_query ($sql, $connection_id)
{
    if (@extension_loaded('mysql')) {

        if ($result = mysql_query($sql, $connection_id)) {

            return $result;

        }else {

            $mysql_error = mysql_error($connection_id);
            trigger_error("<p>SQL: $sql</p><p>MySQL Said: $mysql_error</p>", E_USER_ERROR);
        }
    }

    if (@extension_loaded('mysqli')) {

        if ($result = mysqli_query($connection_id, $sql)) {

            return $result;

        }else {

Line 115:--> $mysql_error = mysqli_error($connection_id);
            trigger_error("<p>SQL: $sql</p><p>MySQL Said: $mysql_error</p>", E_USER_ERROR);
        }
    }

    trigger_error("Could not perform query. Please check that the PHP MySQL or MySQLi extension is correctly installed!", E_USER_ERROR);
}

So can any SQL guru's tell me whats wrong with the syntax? Or maybe how I can figure out how to modify it so that it wont return errors? One guy on IRC mentioned modifying the dbquery lines (which is obviosly at the root of this particular error) to something else.

Leep in mind that before yesterday I'd never touched Apache, PHP or MySQL further than knowledge of what they were and bit of how they did their respective tasks. So when telling me what I need to do/fix an example or two would help. I've got a decent backround in programming so concepts aren't so foriegn to me, but I'm no pro so speak slowly.

I'll see what I can do about learning what I can about MySQL in the meantime but I get the impression that the problems are arising in the PHP files syntax and maybe a bit of how they're passing things between themselves.


Top
  Profile  
 
 Post subject:
PostPosted: Wed Mar 30, 2005 7:32 am 
In the lab!
In the lab!
User avatar

Joined: Sun Jun 06, 2004 10:47 am
Posts: 831
Location: Secret Laboratory
busy and need to get to work so just a quicky but I'm pretty sure your table syntax is wrong... atleast this is how I always do it:

CREATE TABLE blah (
number INT
) TYPE=MyISAM;

the way you have it now you're basically saying create a table named "engine=myisam" and it sees the = sign and goes whoa there! you can't have an = sign in a table name!

btw type and engine are interchangable... well sort of. type has been the way it's been done since mysql support different engines, way back in some 3.x.x version, but starting in the mysql 4.0.18 the new prefered term is engine.


Top
  Profile  
 
 Post subject:
PostPosted: Wed Mar 30, 2005 9:36 am 
Smithfield
Smithfield
User avatar

Joined: Sun Sep 05, 2004 9:01 am
Posts: 8091
So I should be changing the
Code:
$sql = "CREATE TABLE {$forum_webtag}_ADMIN_LOG (";
lines to:
Code:
$sql = "CREATE TABLE {$forum_webtag}_ADMIN_LOG (" ENGINE=MyISAM;
?

Damn IRC bums... I had wondered that myself.

EDIT: Ahhhh Damnit!! I was looking around with MySQL Administrator and as it turns out it has a convenient database browser built in, the tables get created but of course they are InnoDB. I manually changed them to MyISAM hoping against hope but of course I got an error about them already existing. I think I can get this to work if I can just change the default engine type in MySQL... anyone know how?

2nd EDIT: Alright! All I needed to do was change the default engine type in the MySQL my.ini file to MyISAM and bam! i've got a forum running!

alright, everything appears working with the possible exception of emails. Not sure where or how their supposed to get sent so now ive gotta look into what smtp server I can use or if i need to run my own or what.


Top
  Profile  
 
 Post subject:
PostPosted: Wed Mar 30, 2005 12:42 pm 
Smithfield
Smithfield
User avatar

Joined: Sun Sep 05, 2004 9:01 am
Posts: 8091
Alright, now I need a vict...erm, a "volunteer" to see if the place works decently. Anyone willing to give it a try?


Top
  Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group