• 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!

[help]Adding custom PHP script to a page

dibiase

New Member
Joined
Jul 24, 2008
Messages
94
Reaction score
1
Location
www.unbeatenrs2.com
Im not a php expert so i look to you guys for the answer to this.

I am trying to add a page to my website(already added index.php contents and layout.php contents) but it gives me a parse error.

the parse error seems to be coming from the ' i have in my script.

ANY HELP IS GRWATLY APPRECIATED!

EDIT: yes this is a custom page for a different game, i am trying to integrate 2 different games in to gesior AAC, this is the only problem i encountered and is my last step

PHP:
Parse error: parse error in C:\wamp\www\highscores2.php on line 15

Line 15:
PHP:
$rank = mysql_query("SELECT name,level,profession,emoney FROM cq_user WHERE name NOT LIKE '%[PM]%' AND  name NOT LIKE '%[GM]%' ORDER by level desc limit 50;");

Entire Script:

PHP:
<?PHP
include("config.php");
$main_content .= '<table width="100%" height="137" border="0" align="center">
<tr>
  <td width="20%"><b>Rank</b></td>
  <td width="20%" align="center"><b>Name</b></td>
  <td width="20%" align="center"><b>Profession</b></td>
  <td width="20%" align="center"><b>Level</b></td>
</tr>
  <tr>
<?php
mysql_select_db($mydb);
	$rank = mysql_query("SELECT name,level,profession,emoney FROM cq_user WHERE name NOT LIKE '%[PM]%' AND  name NOT LIKE '%[GM]%' ORDER by level desc limit 50;");

	$i=1;
	while($row = mysql_fetch_array($rank)){
	if($row['profession']==10){
		$profesion='Mage';
	}
        if($row['profession']==30){
		$profesion='Palidan';
	}
	if($row['profession']==20){
		$profesion='Warrior';
	}
		echo '
    <td>'.$i.'-</td>
    <td><div align="center">'.$row['name'].'</td>
    <td><div align="center">'.$profesion.'</td>
    <td><div align="center">'.$row['level'].'</td>
  </tr> ';
  $i=$i+1;
	}


?>
</tr></table>';
?>
 
Last edited:
u can try this:
Code:
<?php
	include("config.php");
	$main_content .= '<table width="100%" height="137" border="0" align="center">
	<tr>
		<td width="20%"><b>Rank</b></td>
		<td width="20%" align="center"><b>Name</b></td>
		<td width="20%" align="center"><b>Profession</b></td>
		<td width="20%" align="center"><b>Level</b></td>
	</tr>';
	mysql_select_db($mydb);
	$rank = mysql_query("SELECT name,level,profession,emoney FROM cq_user WHERE name NOT LIKE '%[PM]%' AND  name NOT LIKE '%[GM]%' ORDER by level desc limit 50;");
	$i=1;
	while($row = mysql_fetch_array($rank)){
		if($row['profession']==10) {
			$profesion='Mage';
		} else if($row['profession']==30) {
			$profesion='Palidan';
		} else if($row['profession']==20){
			$profesion='Warrior';
		}
		$main_content .= '<td>'.$i.'-</td>
		<td><div align="center">'.$row['name'].'</td>
		<td><div align="center">'.$profesion.'</td>
		<td><div align="center">'.$row['level'].'</td>
		</tr> ';
		$i++;
	}
?>
 
Last edited:
Back
Top