我的新代码有问题,错误是 Parse error: syntax error, unexpected $end in C:\Program Files (x86)\Ampps\www\New\app\view\haraji.phtml on line 230 这个代码是关于从数据库中获取一些数据并将其放入静态表中!
在没有任何价值的地方,它会显示“没有价值”!在别人看来价值!
这是我的代码:
enter code here
<?php
include('app/config.php');
$con = mysql_connect($AppConfig['db']['host'],$AppConfig['db']['user'],$AppConfig['db']['password']) or die (mysql_error());
mysql_select_db($AppConfig['db']['database'],$con);
$Tak = $this->player->playerId;
$res = mysql_query("SELECT * FROM p_haraji" );
$i=0;
$id = array();
$id['0']=0;
$id['1']=0;
$id['2']=0;
$id['3']=0;
while ($row = mysql_fetch_array($res)){
$id['$i']= $i + 1;
$i++;
}
while (!$row = mysql_fetch_array($res)){
if($i<4){
$id['$i']= 0;
$i++;
}
}
$rsltmsg = mysql_query("SELECT * FROM p_players WHERE id='$Tak'" );
$row1 = mysql_fetch_assoc($rsltmsg);
$nameix=$row1['name'];
$restmsg1=mysql_query("SELECT * FROM p_players WHERE player_type=2" );
$row2 = mysql_fetch_assoc($restmsg1);
$nameadmin=$row2['name'];
$idadmin=$row2['id'];
$subject1="جنس خریداری شد.";
If(isset ($_GET['k'])){
If($_GET['k'] == "1"){
If($this->data['silver'] >= $price){
$newsilver = $this->data['silver'] - $price;
if( $type == '1'){
mysql_query("UPDATE p_players set popkat=popkat + 1 where id='{$Tak}'");
}
else if( $type == '2'){
mysql_query("UPDATE p_players set hemkat=hemkat + 1 where id='{$Tak}'");
}
else if( $type == '3'){
mysql_query("UPDATE p_players set satl=satl + 1 where id='{$Tak}'");
}
mysql_query("UPDATE p_players set silver='$newsilver' where id='{$Tak}'");
$sendsms="جنس خریداری شد!";
mysql_query("UPDATE p_players SET new_mail_count=new_mail_count+1 where id='$Tak' ") or die(mysql_error());
mysql_query("INSERT INTO `p_msgs` (`from_player_id`, `to_player_id`, `from_player_name`, `to_player_name`, `msg_title`, `msg_body`, `creation_date`, `is_readed`, `delete_status`) VALUES( '$idadmin', '$Tak', '$nameadmin', '$nameix', '$subject', '$sendsms', now(), 0, 0)");
}Else{$errorgold = "1";}
If($_GET['k'] == "2"){
If($this->data['silver'] >= $price){
$newsilver = $this->data['silver'] - $price;
if( $type == '1'){
mysql_query("UPDATE p_players set popkat=popkat + 1 where id='{$Tak}'");
}
else if( $type == '2'){
mysql_query("UPDATE p_players set hemkat=hemkat + 1 where id='{$Tak}'");
}
else if( $type == '3'){
mysql_query("UPDATE p_players set satl=satl + 1 where id='{$Tak}'");
}
mysql_query("UPDATE p_players set silver='$newsilver' where id='{$Tak}'");
$sendsms="جنس خریداری شد!";
mysql_query("UPDATE p_players SET new_mail_count=new_mail_count+1 where id='$Tak' ") or die(mysql_error());
mysql_query("INSERT INTO `p_msgs` (`from_player_id`, `to_player_id`, `from_player_name`, `to_player_name`, `msg_title`, `msg_body`, `creation_date`, `is_readed`, `delete_status`) VALUES( '$idadmin', '$Tak', '$nameadmin', '$nameix', '$subject', '$sendsms', now(), 0, 0)");
}Else{$errorgold = "1";}
If($_GET['k'] == "3"){
If($this->data['silver'] >= $price){
$newsilver = $this->data['silver'] - $price;
if( $type == '1'){
mysql_query("UPDATE p_players set popkat=popkat + 1 where id='{$Tak}'");
}
else if( $type == '2'){
mysql_query("UPDATE p_players set hemkat=hemkat + 1 where id='{$Tak}'");
}
else if( $type == '3'){
mysql_query("UPDATE p_players set satl=satl + 1 where id='{$Tak}'");
}
mysql_query("UPDATE p_players set silver='$newsilver' where id='{$Tak}'");
$sendsms="جنس خریداری شد!";
mysql_query("UPDATE p_players SET new_mail_count=new_mail_count+1 where id='$Tak' ") or die(mysql_error());
mysql_query("INSERT INTO `p_msgs` (`from_player_id`, `to_player_id`, `from_player_name`, `to_player_name`, `msg_title`, `msg_body`, `creation_date`, `is_readed`, `delete_status`) VALUES( '$idadmin', '$Tak', '$nameadmin', '$nameix', '$subject', '$sendsms', now(), 0, 0)");
}Else{$errorgold = "1";}
If($_GET['k'] == "4"){
If($this->data['silver'] >= $price){
$newsilver = $this->data['silver'] - $price;
if( $type == '1'){
mysql_query("UPDATE p_players set popkat=popkat + 1 where id='{$Tak}'");
}
else if( $type == '2'){
mysql_query("UPDATE p_players set hemkat=hemkat + 1 where id='{$Tak}'");
}
else if( $type == '3'){
mysql_query("UPDATE p_players set satl=satl + 1 where id='{$Tak}'");
}
mysql_query("UPDATE p_players set silver='$newsilver' where id='{$Tak}'");
$sendsms="جنس خریداری شد!";
mysql_query("UPDATE p_players SET new_mail_count=new_mail_count+1 where id='$Tak' ") or die(mysql_error());
mysql_query("INSERT INTO `p_msgs` (`from_player_id`, `to_player_id`, `from_player_name`, `to_player_name`, `msg_title`, `msg_body`, `creation_date`, `is_readed`, `delete_status`) VALUES( '$idadmin', '$Tak', '$nameadmin', '$nameix', '$subject', '$sendsms', now(), 0, 0)");
}Else{$errorgold = "1";}
};
If(isset($errorgold) AND $errorgold == "1"){echo "<h3>لطفا شما کم است</h3>";}
echo 'شما <img src="assets/x.gif" class="gold" alt="طلا" title="طلا">'.$this->data['gold_num']." مقدار طلا داريد <BR / >";
?>
<table class="rate_details lang_rtl lang_ar" cellpadding="1" cellspacing="1">
<thead>
<tr>
<th colspan="5"><center>حراجی</center></th>
</tr>
<tr>
<td>
شماره
</td>
<td>
صاحب
</td>
<td>
قیمت
</td>
<td>
نوع جنس
</td>
<td>
خريد
</td>
</tr>
</thead>
<tbody>
<!-- <jens1> -->
<tr>
<td>
<?php echo $id['0']; ?>
</td>
<td>
<?php if( $id['0'] != '0'){ $res1 = mysql_query("SELECT * FROM p_haraji where id='{$id['0']}'" ); $row1 = mysql_fetch_array($res1); $id_saheb=$row1['owner']; $res11 = mysql_query("SELECT * FROM p_players where id='{$id_saheb}'" ); $row11 = mysql_fetch_array($res11); $name=$row11['name']; echo $name;} else { echo "جنسی موجود نیست";}?>
</td>
<td>
<?php if( $id['0'] != '0'){ $res1 = mysql_query("SELECT * FROM p_haraji where id='{$id['0']}'" ); $row1 = mysql_fetch_array($res1); $price=$row1['price']; echo $price;} else { echo "جنسی موجود نسیت";}?>
</td>
<td>
<?php if( $id['0'] != '0'){ $res1 = mysql_query("SELECT * FROM p_haraji where id='{$id['0']}'" ); $row1 = mysql_fetch_array($res1); $type=$row1['type']; if($type == '1'){ echo "کتیبه جمعیت";} else if($type == '2'){ echo "کتیبه حمایت";} else if ( $type == '3'){ echo "سطل";}} else { echo "جنسی موجود نیست";}?>
</td>
<td>
<?php if($id['0'] != '0'){ echo "<a href=\"haraji.php?k=1\">خرید</a>";} else { echo "غیر فعال";}?>
</td>
</tr>
<!-- </jens1> -->
<!-- <jens2> -->
<tr>
<td>
<?php echo $id['1']; ?>
</td>
<td>
<?php if( $id['1'] != '0'){ $res2 = mysql_query("SELECT * FROM p_haraji where id='{$id['1']}'" ); $row2 = mysql_fetch_array($res2); $id_saheb=$row2['owner']; $res22 = mysql_query("SELECT * FROM p_players where id='{$id_saheb}'" ); $row22 = mysql_fetch_array($res22); $name=$row22['name']; echo $name;} else { echo "جنسی موجود نیست";}?>
</td>
<td>
<?php if( $id['1'] != '0'){ $res2 = mysql_query("SELECT * FROM p_haraji where id='{$id['1']}'" ); $row2 = mysql_fetch_array($res2); $price=$row2['price']; echo $price;} else { echo "جنسی موجود نسیت";}?>
</td>
<td>
<?php if( $id['1'] != '0'){ $res2 = mysql_query("SELECT * FROM p_haraji where id='{$id['1']}'" ); $row2 = mysql_fetch_array($res2); $type=$row2['type']; if($type == '1'){ echo "کتیبه جمعیت";} else if($type == '2'){ echo "کتیبه حمایت";} else if ( $type == '3'){ echo "سطل";}} else { echo "جنسی موجود نیست";}?>
</td>
<td>
<?php if($id['1'] != '0'){ echo "<a href=\"haraji.php?k=2\">خرید</a>";} else { echo "غیر فعال";}?>
</td>
</tr>
<!-- </jens2> -->
<!-- <jens3> -->
<tr>
<td>
<?php echo $id['2']; ?>
</td>
<td>
<?php if( $id['2'] != '0'){ $res3 = mysql_query("SELECT * FROM p_haraji where id='{$id['2']}'" ); $row3 = mysql_fetch_array($res3); $id_saheb=$row3['owner']; $res33 = mysql_query("SELECT * FROM p_players where id='{$id_saheb}'" ); $row33 = mysql_fetch_array($res33); $name=$row33['name']; echo $name;} else { echo "جنسی موجود نیست";}?>
</td>
<td>
<?php if( $id['2'] != '0'){ $res3 = mysql_query("SELECT * FROM p_haraji where id='{$id['2']}'" ); $row3 = mysql_fetch_array($res3); $price=$row3['price']; echo $price;} else { echo "جنسی موجود نسیت";}?>
</td>
<td>
<?php if( $id['2'] != '0'){ $res3 = mysql_query("SELECT * FROM p_haraji where id='{$id['2']}'" ); $row3 = mysql_fetch_array($res3); $type=$row3['type']; if($type == '1'){ echo "کتیبه جمعیت";} else if($type == '2'){ echo "کتیبه حمایت";} else if ( $type == '3'){ echo "سطل";}} else { echo "جنسی موجود نیست";}?>
</td>
<td>
<?php if($id['2'] != '0'){ echo "<a href=\"haraji.php?k=3\">خرید</a>";} else { echo "غیر فعال";}?>
</td>
</tr>
<!-- </jens3> -->
<!-- <jens4> -->
<tr>
<td>
<?php echo $id['3']; ?>
</td>
<td>
<?php if( $id['3'] != '0'){ $res4 = mysql_query("SELECT * FROM p_haraji where id='{$id['3']}'" ); $row4 = mysql_fetch_array($res4); $id_saheb=$row4['owner']; $res44 = mysql_query("SELECT * FROM p_players where id='{$id_saheb}'" ); $row44 = mysql_fetch_array($res44); $name=$row44['name']; echo $name;} else { echo "جنسی موجود نیست";}?>
</td>
<td>
<?php if( $id['3'] != '0'){ $res4 = mysql_query("SELECT * FROM p_haraji where id='{$id['3']}'" ); $row4 = mysql_fetch_array($res4); $price=$row4['price']; echo $price;} else { echo "جنسی موجود نسیت";}?>
</td>
<td>
<?php if( $id['3'] != '0'){ $res4 = mysql_query("SELECT * FROM p_haraji where id='{$id['3']}'" ); $row4 = mysql_fetch_array($res4); $type=$row4['type']; if($type == '1'){ echo "کتیبه جمعیت";} else if($type == '2'){ echo "کتیبه حمایت";} else if ( $type == '3'){ echo "سطل";}} else { echo "جنسی موجود نیست";}?>
</td>
<td>
<?php if($id['3'] != '0'){ echo "<a href=\"haraji.php?k=4\">خرید</a>";} else { echo "غیر فعال";}?>
</td>
</tr>
<!-- </jens3> -->
</tbody>
</table>
<?php
mysql_close($con);
?>
enter code here