Now I've reinstalled my forum, and tried to use this code I get this error..//Select clan with Highest ID (Clan Just added)
$query = "SELECT MAX(clan_id) FROM phpbb_rivals_clans";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
//Define var whcih has highest clan id
$clfanid = $row['MAX(clan_id)'];
//Add Clan to Clan Direcotry
mysql_query("INSERT INTO phpbb_rivals_clanladders (clan_id, ladder_id) VALUES ($clfanid, '2') ") or die(mysql_error());
:s[phpBB Debug] PHP Notice: in file /rivals/add_clan.php on line 23: mysql_query() [function.mysql-query]: Access denied for user 'benalec'@'localhost' (using password: NO)
[phpBB Debug] PHP Notice: in file /rivals/add_clan.php on line 23: mysql_query() [function.mysql-query]: A link to the server could not be established
[phpBB Debug] PHP Notice: in file /rivals/add_clan.php on line 24: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
[phpBB Debug] PHP Notice: in file /rivals/add_clan.php on line 30: mysql_query() [function.mysql-query]: Access denied for user 'benalec'@'localhost' (using password: NO)
[phpBB Debug] PHP Notice: in file /rivals/add_clan.php on line 30: mysql_query() [function.mysql-query]: A link to the server could not be established
Access denied for user 'benalec'@'localhost' (using password: NO)
Code: Select all
$last_id = $db->sql_insertid ( ); // I think thats what the function is called, sql_insertid?
//Add Clan to Clan Direcotry
$db->sql_query("INSERT INTO phpbb_rivals_clanladders (clan_id, ladder_id) VALUES ($last_id, '2') ");
Don't think it is, I'll ahve a look aroudn see what it isFatal error: Call to undefined method dbal_mysqli::sql_insertid() in /home/benalec/public_html/rivals/add_clan.php on line 21
mysql_insert_id — Get the ID generated from the previous INSERT operation
Code: Select all
$last_id = $db->sql_nextid ( );
//Add Clan to Clan Direcotry
$db->sql_query("INSERT INTO phpbb_rivals_clanladders (clan_id, ladder_id) VALUES ($last_id, '2') ");
Code: Select all
SQL ERROR [ mysql4 ]
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(ps3)' at line 1 [1064]
SQL
SELECT * FROM phpbb3_rivals_ladders WHERE ladder_id = cod4 (ps3)
BACKTRACE
FILE: includes/db/mysql.php
LINE: 158
CALL: dbal_mysql->sql_error()
FILE: rivals/classes/class_ladder.php
LINE: 61
CALL: dbal_mysql->sql_query()
FILE: rivals/classes/class_ladder.php
LINE: 25
CALL: ladder->data()
FILE: rivals/acp_reportmatch.php
LINE: 10
CALL: ladder->ladder()
FILE: rivals.php
LINE: 40
CALL: include('rivals/acp_reportmatch.php')
Code: Select all
SQL ERROR [ mysql4 ]
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND clan_2id = ""' at line 1 [1064]
SQL
SELECT * FROM phpbb3_rivals_treports WHERE report_tournament = 3 AND clan_1id = AND clan_2id = ""
BACKTRACE
FILE: includes/db/mysql.php
LINE: 158
CALL: dbal_mysql->sql_error()
FILE: rivals/ccp_tournaments.php
LINE: 30
CALL: dbal_mysql->sql_query()
FILE: rivals.php
LINE: 40
CALL: include('rivals/ccp_tournaments.php')
Code: Select all
SQL ERROR [ mysql4 ]
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(ps3)' at line 1 [1064]
SQL
SELECT * FROM phpbb3_rivals_ladders WHERE ladder_id = cod4 (ps3)
BACKTRACE
FILE: includes/db/mysql.php
LINE: 158
CALL: dbal_mysql->sql_error()
FILE: rivals/classes/class_ladder.php
LINE: 61
CALL: dbal_mysql->sql_query()
FILE: rivals/classes/class_ladder.php
LINE: 25
CALL: ladder->data()
FILE: rivals/ccp_ladders.php
LINE: 9
CALL: ladder->ladder()
FILE: rivals.php
LINE: 40
CALL: include('rivals/ccp_ladders.php')
Code: Select all
$template->assign_vars(array(
'POSTS_DAY' => sprintf($user->lang['POST_DAY'], $posts_per_day),
Code: Select all
// Initilize the includes and variables needed.
define ( 'CLANMEMBERS_TABLE', $table_prefix . 'rivals_clanmembers' );
define ( 'CLANS_TABLE', $table_prefix . 'rivals_clans' );
define ( 'CLANLADDERS_TABLE', $table_prefix . 'rivals_clanladders' );
include ( $phpbb_root_path . 'rivals/classes/class_clan.' . $phpEx );
$clan = new clan ( );
// Get the clans the user is apart of...
$sql8 = 'SELECT * FROM ' . CLANMEMBERS_TABLE . ' WHERE member_userid = ' . $member[ 'user_id' ] . ' AND member_status = 1';
$result8 = $db->sql_query ( $sql8 );
while ( $row8 = $db->sql_fetchrow ( $result8 ) )
{
// Now, provide a template loop to display the clans.
$template->assign_block_vars ( 'block_clans', array (
'U_CLANNAME' => append_sid ( 'rivals.php?action=clan_profile&clan_id=' . $row8[ 'member_clan' ] ),
'S_CLANNAME' => $clan->data ( 'clan_name', $row8[ 'member_clan' ] ) )
);
}
// Get the clans the user leads or co-leads
$sql9 = 'SELECT * FROM ' . CLANS_TABLE . ' WHERE (clan_owner = ' . $member[ 'user_id' ] . ' OR clan_ownerb = ' . $member[ 'user_id' ] . ')';
$result9 = $db->sql_query ( $sql9 );
if ( $db->sql_affectedrows ( $result9 ) < 1 && $db->sql_affectedrows ( $result8 ) < 1 )
{
$template->assign_block_vars ( 'block_noleadclans', array (
'L_NOLEADCLANS' => 'Clanless',
'L_INVITE' => 'Invite User',
'U_INVITE' => append_sid ( 'rivals.php?action=clan_profile&clan_id=' . $member[ 'user_id' ] ),
));
}
else
{
while ( $row9 = $db->sql_fetchrow ( $result9 ) )
{
// Now, provide a template loop to display the clans.
$template->assign_block_vars ( 'block_leadclans', array (
'U_CLANNAME' => append_sid ( 'rivals.php?action=clan_profile&clan_id=' . $row9[ 'clan_id' ] ),
'S_CLANNAME' => $row9[ 'clan_name' ] )
);
}
}
Code: Select all
<!-- BEGIN block_clans -->
<a href="{block_clans.U_CLANNAME}">{block_clans.S_CLANNAME}</a><br />
<!-- END block_clans -->
<!-- BEGIN block_leadclans -->
<a href="{block_leadclans.U_CLANNAME}">{block_leadclans.S_CLANNAME}</a><br />
<!-- END block_leadclans -->
<!-- BEGIN block_noleadclans -->
{block_noleadclans.L_NOLEADCLANS}
<!-- END block_noleadclans -->
Code: Select all
SQL ERROR [ mysqli ]
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 [1064]
SQL
SELECT * FROM phpbb_rivals_ladders WHERE ladder_id =
BACKTRACE
FILE: includes/db/mysqli.php
LINE: 143
CALL: dbal->sql_error()
FILE: rivals/ccp_ladders.php
LINE: 82
CALL: dbal_mysqli->sql_query()
FILE: rivals.php
LINE: 40
CALL: include('rivals/ccp_ladders.php')