Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 1 of 1
 
 
Reply with quote Download Post 
Post Problem With Sql " Trying To Port A Mod" 
 
hi i got a small problem

I´m trying to port F-1 Webtip Mod from .27 to 1.3

At the moment everything is fine but i have a problem with the table prefixes

i got for example this code :
Code: [Download] [Hide] [Select]
// Pull all config data
//
$sql = "SELECT * FROM " . 'FORMEL_CONFIG_TABLE';
if(!$result = $db->sql_query($sql))
{
    message_die(GENERAL_ERROR, "Could not query config information in formel configuration", "", __LINE__, __FILE__, $sql);
}
else
{
    while( $row = $db->sql_fetchrow($result) )
    {
        $config_name = $row['config_name'];
        $config_value = $row['config_value'];
        $default_config[$config_name] = isset($HTTP_POST_VARS['submit']) ? str_replace("'", "\'", $config_value) : $config_value;
        $new[$config_name] = ( isset($HTTP_POST_VARS[$config_name]) ) ? $HTTP_POST_VARS[$config_name] : $default_config[$config_name];

        if( isset($HTTP_POST_VARS['submit']) )
        {
            $sql = "UPDATE " . 'FORMEL_CONFIG_TABLE'. "
                    SET config_value = '" . str_replace("\'", "''", $new[$config_name]) . "'
                    WHERE config_name = $config_name";
            if( !$db->sql_query($sql) )
            {
                message_die(GENERAL_ERROR, "Failed to update configuration for $config_name", "", __LINE__, __FILE__, $sql);
            }
        }
    }

    if( isset($HTTP_POST_VARS['submit']) )
    {
        $message = $lang['formel_acp_config_updated'] . "<br /><br />" . sprintf($lang['Click_return_config'], "<a href=\"" . append_sid('admin_formel_config.'. PHP_EXT) . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid('index.'. PHP_EXT.'?pane=right'.PHP_EXT) . "\">", "</a>");
        message_die(GENERAL_MESSAGE, $message);
    }
}




and i get this error message :
Quote:
Could not query config information in formel configuration

DEBUG MODE

SQL Error : 1146 Table 'ip.ip_formel_config' doesn't exist

SELECT * FROM ip_formel_config

Line : 82
File : admin_formel_config.php


As you see
The mod is calling Db by name and then the table prefix.
 




____________
Out of Order
 
spydieSend private messageVisit poster's website  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: Problem With Sql " Trying To Port A Mod" 
 
Are you sure you have created the table in your DB?

Check also table prefix in phpMyAdmin.
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Problem With Sql " Trying To Port A Mod" 
 
checked that allready.

the same happens then it tries to call GROUPS_table
 




____________
Out of Order
 
spydieSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Problem With Sql " Trying To Port A Mod" 
 
Well the error is self explaining... the table doesn't exist.

Check also that constants are defined properly.
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Problem With Sql " Trying To Port A Mod" 
 
you see this ??

SQL Error : 1146 Table 'ip.ip_formel_config' doesn't exist

its calling ip.ip_


Edit:
Need some glasses.

Sh...

Next sql error.

And please don´t tell me the table does'nt exist

That´s an standart table of IP and i´ve checked 5 times before posting my code :
Code: [Download] [Hide] [Select]
// Get all group data
//
$combo_groups_entries = '';
$sql = "SELECT * FROM " . 'GROUPS_TABLE'."
        WHERE group_single_user = 0";
if (!$result = $db->sql_query($sql))
{
    message_die(GENERAL_ERROR, 'Could not query groups data', '', __LINE__, __FILE__, $sql);
}
while ($row = $db->sql_fetchrow($result))
{
    $selected = ( $row['group_id'] == $new['restrict_to'] ) ? 'selected' : '';
    $combo_groups_entries .= '<option value="' . $row['group_id'] . '" ' . $selected . '>' . $row['group_name'] . '</option>';
}
$db->sql_freeresult($result);



And imagine the error:

Yes you got it:
Spoiler: [ Show ]

 




____________
Out of Order
 
spydieSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: [SOLVED] Problem With Sql " Trying To Port A Mod" 
 
spydie wrote: [View Post]
SQL Error : 1146 Table 'ip.groups_table' doesn't exist

SELECT * FROM GROUPS_TABLE WHERE group_single_user = 0

Line : 139
File : admin_formel_config.php

You are missing the quotes there...

Query should be as follows:

Code: [Download] [Hide] [Select]
"SELECT * FROM " . GROUPS_TABLE . " WHERE group_single_user = 0"

 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Post new topic  Reply to topic  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events