• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

AAC SELL CHAR page problem

jel

Member
Joined
Mar 22, 2014
Messages
302
Reaction score
12
hello, I have this problem when trying to open the page.

erro line: $players_from_logged_acc->orderBy('name');
funcion:
$players_from_logged_acc->orderBy('name');
$main_content .= '<form action="" method="post"><select name="char">';
foreach($players_from_logged_acc as $player)
{
$main_content .= '<option>'.$player->getName().'</option>';
}
Query:SELECT id, name, password, premdays, coins, lastday, email, key, create_ip, creation, page_access, location, rlname, birth_date, gender, email_new, email_new_time, email_code, next_email, last_post, flag, vote, loyalty_points, guild_points, premium_points, vip_time FROM accounts WHERE name = 'teste'
SQLSTATE:00000
Driver code:
Error message:
PHP:
<?PHP
    if($logged) {
        $main_content .= '<center><b>Here you can put your character on sale!</center></b><br>';
        $main_content .= 'If you put your character on sale anyone can buy it, you will lose acces to that character and you wont be able to log in with that character until someone buys it, you can also delete your offer by talking to an admin!<br><b>when someone buys your character you will get the price in points!</b>';
        $main_content .= '<br>';
        $main_content .= '<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD CLASS=white width="64px"><CENTER><B>Sell your characters</B></CENTER></TD></TR>';
        $main_content .= '<TR BGCOLOR='.$config['site']['darkborder'].'><TD CLASS=black width="64px"><B></B>';
        
        $players_from_logged_acc = $account_logged->getPlayersList();
                            
                                $players_from_logged_acc->orderBy('name');
                                $main_content .= '<form action="" method="post"><select name="char">';
                                foreach($players_from_logged_acc as $player)
                                {
                                    $main_content .= '<option>'.$player->getName().'</option>';
                                }
        
        $main_content .= '</select>Select a character to sell<br>';
        $main_content .= '<input type="text" name="price" maxlength="10" size="4" >Select the price of the character<br>';
        $main_content .= '<input type="submit" name="submit" value="Sell character"></TD></TR>';
                            $main_content .= '</form></table>';
                            
                            if (isset($_POST['submit'])) {
                                
                            $char = stripslashes($_POST['char']);
                            $price = stripslashes($_POST['price']);
                            
                            if ($char && $price) {

                                if(is_numeric(trim($_POST['price']))) {
                                
                                        $check2 = $SQL->query("SELECT * FROM `players` WHERE `name` = '$char'") or die(mysql_error());
                                foreach ($check2 as $re) {
                                    $voc = $re['vocation'];
                                    $oid = $re['account_id'];
                                }
                                $check1 = $SQL->query("UPDATE `players` SET `account_id` = 1 WHERE `name` = '$char'") or die(mysql_error());
                                $check3 = $SQL->query("INSERT INTO `sellchar` VALUES ('','$char','$voc','$price','1','$oid')");
                                $main_content .= '<b><center>You added your character correctly, thanks!</b></center>';
                                header("Location: index.php?subtopic=buychar");
                                
                                } else {
                            
                                $main_content .= '<b><center>Set a numeric price!!</b></center>';
                                }
                                
                            } else {
                                    $main_content .= '<b><center>Fill out all fields!</b></center>';
                            }
                            
                        }
    } else {
        $main_content .= '<b><center>Please log in first!</b></center>';
    }
?>
 
You're very vague on this one.
It looks pretty organized how you submitted the question, we just do not have enough information to actually help you.

What does the actual error say?
I bet it doesn't say:
erro line: $players_from_logged_acc->orderBy('name');

Sincerely,
Ralumbi
 
Back
Top