1 (edited by zaher 2006-10-23 23:23)

Topic: Punbb and Firebid SQL for test only.

This is not MOD or release to download, it is just to test supporting firebird.

Download it from punbb-1.2.14-firebird-v1.zip
Install Firebird SQL 2 engine from www.firebirdsql.org, be sure it is version 2
install FlameRobin (www.flamerobin.org)
enable php_interbase.dll in php.ini
Create new database with flamerobin as "c:\temp\punbb.fdb" for example and use it in install punbb as it in "Database name" field
the default user for Firebird is SYSDBA and password MASTERKEY

Go to your forum and install PunBB with install.php

This is not MOD or Branch PunBB becuase it is hard to re MOD this PunBB every time released.

1 - insert_id function removed

There is a dblayer for Firebird2 but Firebird not have mysql_insert_id funtion
i resolved this probelm with RETURNING feature in Firebird

  insert into posts ..... returning id
 
and the firebird make it as select and retrun id value after insert the record
i pass the 'id' field name in function "execute" instead of function "query"

function execute($sql, $field_id)

2 - num_rows function removed
mysql_insert_id not found in firebird and if i emualte it useing COUNT that make PunBB so slowly
the easy way it recode the punbb and remove all uses num_rows
num_rows is uses about 70 time in all code, almost of them used to check if there is a rows result only
i replaced with fetch_row to take the same effect

and it used to take the number of rows and make a for loop, i converted to while loop

3 - function result changed

function result($query_id = 0, $row = 0);

function result($query_id = 0);

mysql_result not found in firebird so seeked record not allow in client side.

/*    $result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$id.' ORDER BY posted') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
    $num_posts = $db->num_ro ws($result);

    for ($i = 0; $i < $num_posts; ++$i)
    {
        $cur_id = $db->result($result, $i);
        if ($cur_id == $pid)
            break;
    }
    ++$i;    // we started at 0*/
    $result = $db->query('SELECT count(id) FROM '.$db->prefix.'posts WHERE topic_id='.$id.' and id<='.$pid.' ') or error('Unable to fetch post count info', __FILE__, __LINE__, $db->error());
    //ORDER BY posted removed but ????
    //May be there is a post date less and id greater???
    $i = $db->result($result);

but we will lost the date sorted here i need some help?

4 - LIMIT changed to ROWS in DBLayer, just runtime hack to keep compatible with MYSQL

5 - "password", "message" are reserved words, i maked dummy tuntime hack to escape it but that bad,
    and change all this word in whole code by add mysql quote escape.
    i prefer change the field name

So here i ask Reckard what must i do after that:
- Keep it as Huge MOD (outch) or Branch.
- Modify PunBB 1.3 to able to be firebird support and wait for 1.3
- Nothing of above (Easy to say it smile )

If your people come crazy, you will not need to your mind any more.

2

Re: Punbb and Firebid SQL for test only.

I update the file for 1.2.14 with some fixes.
punbb-1.2.14-firebird-v1.zip
It is so hard to do that, i hate branching.
I added v1 that mean sub version for my release.

If your people come crazy, you will not need to your mind any more.