Jump to content

Fatal error: Call to a member function select() on a non-object


chris_2001

Recommended Posts

Fatal error: Call to a member function select() on a non-object in C:\xampp\htdocs\templates\offlike\community\community.donate.php on line 272

 

Thats my error, can't figure out whats wrong, maybe someone will be able to help. Thanks in advance. I have marked the error line (272)  //////// Error line 272///////.

<?php if($user['id']>0){ ?>
<style media="screen" title="currentStyle" type="text/css">
    .postContainerPlain {
        font-family:arial,palatino, georgia, verdana, arial, sans-serif;
        color:#000000;
        padding:5px;
        margin-bottom: 4px;
        font-size: x-small;
        font-weight: normal;
        background-color: #E7CFA3;
        background-image: url('<?php echo $config['template_href'];?>images/light.jpg');
        border-style: solid; border-color: #000000; border-width: 0px; border-bottom-width:1px; border-top-width:1px;
        line-height:140%;
  }
    .postBody {
        padding:10px;
        line-height:140%;
        font-size: small;
  }
    .title {
        font-family: palatino, georgia, times new roman, serif;
        font-size: 13pt;
        color: #640909;
    }
</style>
<style type = "text/css">
  tr.serverStatus1 { border-style: solid; border-width: 1px 0px 0px 1px; border-color: #D8BF95; }
  tr.serverStatus2 { border-style: solid; border-width: 1px 0px 0px 1px; border-color: #D8BF95; background-color: #C3AD89; }
  td.rankingHeader { color: #C7C7C7; font-size: 10pt; font-family: arial,helvetica,sans-serif; font-weight: bold; background-color: #2E2D2B; border-style: solid; border-width: 1px; border-color: #5D5D5D #5D5D5D #1E1D1C #1E1D1C; padding: 3px;}
</style>

<style type="text/css">


	#mouseTrapMenu
   {
		position: absolute;
		visibility: hidden;
		width: 525px;
		top: -400px;
		left: -200px;
		Z-INDEX: 10001;
   }

#wrapper3 {
position: relative;
		z-index: 100;
}

	#indexHighest { position: relative;
		z-index: 10000;
       }

a.menuLeft:link		{
		font-family:  arial,verdana, sans-serif;
		color: CBA300;
		font-size: 8pt;
		line-height:140%;
		font-weight:bold;
		display: block;
		}
a.menuLeft:visited 	{
		font-family:  arial,verdana, sans-serif;
		font-size: 8pt;
		line-height:140%;
		font-weight:bold;color: #CBA300; display: block;}
a.menuLeft:hover	{
		font-family:  arial,verdana, sans-serif;
		font-size: 8pt;
		line-height:140%;
		font-weight:bold;color: #ffffff;
		background-color: #0B2237;
		display: block;}
a.menuLeft:active 	{
		line-height:140%;
		font-family:  arial,verdana, sans-serif;
		font-size: 8pt;
		font-weight:bold;
		color: #FFFFFF; display: block;}

.menuLeftOff {
		font-family:  arial,verdana, sans-serif;
		text-decoration: underline;
		color: CBA300;
		font-size: 8pt;
		line-height:140%;
		font-weight:bold; display: block;
}

.menuLeftOver {
		font-family:  arial,verdana, sans-serif;
		text-decoration: underline;
		color: FFFFFF;
		font-size: 8pt;
		line-height:140%;
		font-weight:bold;
		display: block;
}


</style>

			  <script language = "javascript">

//Show layer//
function showLayer(layerName){

obj = document.getElementById(layerName);
obj.style.visibility="visible";

}

//Hide layer//
function hideLayer(layerName){

obj = document.getElementById(layerName);
obj.style.visibility="hidden";

}
			</script>

<style type="text/css">
small 	{font-family: verdana, arial, sans-serif; font-size:8pt; font-weight:normal;}

.smallBold {font-family:verdana, arial, sans-serif; font-size:11px; font-weight:bold;}

   	   #text { position: absolute;
		top: 128px;
		left: 0px;

       }

	#char { position: absolute;
		top: -103;
		left: -20;

       }

	#wrapper { position: relative;
		z-index: 100;
       }

	#wrapper99 { position: relative;
		z-index: 99;
       }
</style>

<table cellspacing="0" cellpadding="0" border="0" width = "100%" background = "<?php echo $config['template_href'];?>images/donation/bg.jpg">
<tr>
<td width = "80%" align = "center">
	<table width = "100%" cellspacing="0" cellpadding="0" border="0">

	<tr>
		<td><div id = "wrapper"><div id = "char"><img src="<?php echo $config['template_href'];?>images/donation/body.gif" width="83" height="177" alt=""></div></div></td>
		<td valign = "top"><img src="<?php echo $config['template_href'];?>images/donation/left.jpg" width="343" height="179" alt=""></td>
<!-------Box Start--->
<td align="right" style="padding-right: 15px; padding-bottom: 15px">
	<!--PlainBox Top-->
	<table cellspacing="0" cellpadding="0" border="0"  border="1"><tr><td width = "3"><img src = "<?php echo $config['template_href'];?>images/donation/plainbox-top-left.gif" width = "3" height = "3" border = "0"></td>
	<td background = "<?php echo $config['template_href'];?>images/donation/plainbox-top.gif"></td><td width = "3"><img src = "<?php echo $config['template_href'];?>images/plainbox/plainbox-top-right.gif" width = "3" height = "3" border = "0"></td>
	</tr><tr><td background = "<?php echo $config['template_href'];?>images/donation/plainbox-left.gif"></td><td style = "background-image: url('<?php echo $config['template_href'];?>images/parchment/plain/light3.jpg');" NOWRAP>
	<!--PlainBox Top-->
	<table cellspacing="0" cellpadding="0" border="0" width = "100%"><tr><td width = "1"><img src = "<?php echo $config['template_href'];?>images/donation/minisubheader-end.gif" width = "1" height = "16"></td><td bgcolor = "#464B3F" width = "100%" NOWRAP>
	<span class = "smallBold" style = "color:white;"><?php echo $lang['contact_info'];?></span></td><td width = "1"><img src = "<?php echo $config['template_href'];?>images/donation/minisubheader-end.gif" width = "1" height = "16"></td></tr></table>

	<table cellspacing = "0" style = "padding-top:5px; padding-left:5px; padding-right: 5px; padding-bottom: 2px;" border = "0"><tr><td align = "center">


	<table cellspacing = "0" cellpadding = "2" border = "0" align="left">
	<tr>
		<td><img src = "<?php echo $config['template_href'];?>images/donation/bullet.gif" width = "14" height = "14"></td>
		<td NOWRAP style="padding-top:3px"><b class="smallbold"><?php echo $lang['forum_support'];?></b></td>
	</tr>
	<tr>
		<td><img src = "<?php echo $config['template_href'];?>images/pixel.gif" width = "14" height = "14"></td>

		<td NOWRAP><small>    <a href = "index.php?n=forum"><?php echo $lang['website_forum_support'];?></a></small></td>
	</tr>
	<tr>
		<td><img src = "<?php echo $config['template_href'];?>images/pixel.gif" width = "14" height = "14"></td>
		<td NOWRAP><small>    <a href = "mailto:<?php echo $config[contact_email]; ?>"><?php echo $lang['email_support'];?></a></small></td>
	</tr>
			</table>

</td>
</tr>
</table>

	<!--PlainBox Bottom-->
	</td><td background = "<?php echo $config['template_href'];?>images/donation/plainbox-right.gif"></td></tr><tr><td><img src = "<?php echo $config['template_href'];?>images/donation/plainbox-bot-left.gif" width = "3"
	height = "3" border = "0"></td><td background = "<?php echo $config['template_href'];?>images/donation/plainbox-bot.gif"></td><td>
	<img src = "<?php echo $config['template_href'];?>images/donation/plainbox-bot-right.gif" width = "3" height = "3" border = "0"></td></tr></table>
	<!--PlainBox Bottom-->

		</td>
	</tr>
	</table>

</td>
</tr>
</table>
<?php


//          End Templates  Start Content         //

if ($_GET['pay'] == finish){

    $ep = $CHDB->select("SELECT * FROM `character` WHERE account='".$user['id']."'");
    foreach($ep as $ap){
        $charid = $ap["guid"];
      $q = $DB->select("SELECT * FROM `paypal_payment_info` WHERE itemname='".$charid."' AND 	item_given != '1'");

        if(count($q) > 0){
            foreach($q as $data){
                echo 'Payment Done.<br />';
                if ($data['item_given'] != 1){

                    // Aditional payment checks can be done here.
                    $donation_template = $DB->selectRow("SELECT * FROM `donation_template` WHERE id='".$data['itemnumber']."'");
                    // Ok, we must check if we actually got the money that we asked for.
                    if ($donation_template['donation'] > $data['mc_gross']){
                    	$NOT_MAIL = TRUE;
                    }else{
                        $NOT_MAIL = FALSE;
                    }

                    if ($NOT_MAIL == FALSE){
                        if (mail_item_donation($data['itemnumber'], $ap['guid']) == TRUE){
                            echo $lang['items_sent']."<br /><ul><li>".$lang['username'].": ".$user['username']."</li><li>".$lang['charname'].": ".$ap['name']."</li><li>".$lang['donate']." ".$lang['l_delkey_id'].": ".$data['itemnumber']."</li><li>".$lang['paymentstatus'].": ".$data['paymentstatus']."</li></ul>";
                    }else{
											echo $lang['items_could_not_be_sent'];
				    }
                    }else{
                    	echo "<ul><li>".$lang['donation_not_face_value']."</li></ul>";
                    }
                }
		}
	}else{
            $no_chars++;
        }
}
    // Add message if we dont find any donation.
    if ($no_chars == count($q)){
        echo "<p>".$lang['no_donations_found_for']." <b>".$user['username']."</b>!</p>";
    }
}elseif ($_GET["pay"] == dublicate){
output_message('alert',$lang['donation_dup_error'].'<meta http-equiv=refresh content="3;url=index.php?n=community&sub=donate">');
}
else{

?>
<table align="center" width="100%"><tr><td align="center">
<div style="margin-right: 0pt;" class="postContainerPlain" align="left">
    <h3 class="title"></h3>
    <div class="postBody" style="list-style:square;">
<?php echo $lang['donation_page_desc'];?>
<br /><br />
<?php

$q = $DB->select("SELECT * FROM `donations_template` ORDER BY id");
foreach($q as $data){
  $id = $data['id'];
?>
<h2><?php echo $data['donation']." ".$data['currency']." :: "; ?> <?php echo $lang['donation_num']; echo $data['id']; if ($data['description'] == TRUE){ echo " :: <font size=2 color=green>".$data['description']."</font> ::"; } ?>  </h2>
<p><?php echo $lang['presents'];?>:</p>
<ul>
<?php
	$items = explode(',',$data['items']);
	foreach($items as $item){ // This was the first time Peec used foreach() Long time ago ^^
        $qray = $WSDB->select("SELECT name FROM `item_template` WHERE entry='".$item."'");
        foreach($qray as $d){
		      echo "<li><a href='http://www.thottbot.com/i$item' target='_blank'>$d[name]</a></li>";
        }
    }

?>
</ul>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="<?php echo $donation_config['PayPal_Email']; ?>">
<?php echo $lang['donation_pick_character'];?><br />
<select name="item_name">
<?php

$qray = $CHDB->select("SELECT * FROM `character` WHERE account='$user[id]'");
foreach($qray as $d){
echo "<option value='".$d['guid']."'>".$d['name']."</option>";
}

?>   //////// Error line 272///////
</select><br />
<input type="hidden" name="item_number" value="<?php echo $data['id']; ?>">
<input type="hidden" name="amount" value="<?php echo $data['donation']; ?>">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="url_notify" value="http://<?php echo str_replace('index.php','donate.php',($_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'])); ?>">
<input type="hidden" name="currency_code" value="<?php echo $data['currency']; ?>">
<input type="hidden" name="lc" value="<?php echo $config['paypallang'];?>">
<input type="hidden" name="bn" value="PP-BuyNowBF">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

<?php
// 4_-C7Ge33t9lmUYJlAfz3gzAPwjh_H1V5JQqfn-QAt0Vm5cowQLpvHZeIK4
}
?>

</div></div>
</td>
</tr></table>

<?php
}
}
?>

Link to comment
Share on other sites

It seems to be saying that the database object you call '$CHDB' doesn't exist when it say's 'non-object', however the other db's seem ok, '$WSDB' and '$DB'.

 

How does it handle when it encounters following?

if ($_GET['pay'] == finish){

    $ep = $CHDB->select("SELECT * FROM `character` WHERE account='".$user['id']."'");

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.