Manigold
Active Member
- Joined
- Nov 2, 2017
- Messages
- 198
- Solutions
- 8
- Reaction score
- 48
I'm having a small problem with znote aac ,when some character has apostrophes in the name ,the characterprofile.php page shows some errors.
This part:
Returns this error:
Del'Toro string(105) "SELECT
(query - SQL error)
Type: select_single (select single row from database)
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Toro' AND
And this part:
Returns this error:
string(276) "SELECT
(query - SQL error)
Type: select_multi (select multiple rows from database)
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Toro' ORDER BY
Hope someone can help me to solve this , thanks in advance.
This part:
PHP:
<?php
// pending deletion?($name)
$deletion_time = mysql_select_single("SELECT `time` FROM `znote_deleted_characters` WHERE `character_name`='{$name}' AND `done` = '0' LIMIT 1;");
if ($deletion_time !== false): ?>
, will be deleted at <?php echo $deletion_time['time']; ?>.
<?php endif; ?>
<!-- end deletion part -->
Del'Toro string(105) "SELECT
time
FROM znote_deleted_characters
WHERE character_name
='Del'Toro' AND done
= '0' LIMIT 1;"(query - SQL error)
Type: select_single (select single row from database)
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Toro' AND
done
= '0' LIMIT 1' at line 1And this part:
PHP:
<!-- FRAGS LIST -->
<?php
$frags = mysql_select_multi("SELECT `pd`.`time`, `pd`.`level`, `pd`.`unjustified`, `pd`.`mostdamage_by`, `pd`.`mostdamage_unjustified`, `p`.`name` FROM `player_deaths` AS `pd` INNER JOIN `players` AS `p` ON `pd`.`player_id`=`p`.`id` WHERE `pd`.`killed_by` = '".$profile_data['name']."' ORDER BY `pd`.`time` DESC LIMIT 10;");
if ($frags) {
?>
<table class="stripped" cellpadding="4">
<table style="width: 100%;/*border:3px double #fff;*/box-shadow:1px 1px 10px #000;" border="0" cellpadding="10" cellspacing="1">
<td colspan="2" style="background-color: #505050;color: #f9f6f6;">Frags List</td>
<tbody>
<?php
foreach ($frags as $f) {
?>
<tr><td width="20%"><i style="font-size:12px">
<?php
echo "".getClock($f['time'], true, true)."</td>";
echo "<td><i style='font-size:12px'>Killed <a href='characterprofile.php?name=".$f['name']."'>".$f['name']."</a> at level ".$f['level'];
echo ($f['unjustified']) === '1' ? " <font color='red' style='font-style: italic;font-size:85%;'>(unjustified)</font>" : " <font color='green' span class='label label-success' style='font-style: italic;font-size:85%;'>(Justified)</font></span>";
echo ($f['mostdamage_by']) !== $profile_data['name'] ? "</br><font color='#5a2800' span class='label label-danger'>Most damage by <a href='characterprofile.php?name=".$f['mostdamage_by']."'>".$f['mostdamage_by']."</a> ".(($f['mostdamage_unjustified']) === '1' ? "<font color='red' span class='label label-danger'>(Unjustified)</span>" : "<font color='green' span class='label label-success' style='font-style: italic;font-size:85%;'>(Justified)</span>") : "";
}
?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<!-- END FRAGS LIST -->
Returns this error:
string(276) "SELECT
pd
.time
, pd
.level
, pd
.unjustified
, pd
.mostdamage_by
, pd
.mostdamage_unjustified
, p
.name
FROM player_deaths
AS pd
INNER JOIN players
AS p
ON pd
.player_id
=p
.id
WHERE pd
.killed_by
= 'Del'Toro' ORDER BY pd
.time
DESC LIMIT 10;"(query - SQL error)
Type: select_multi (select multiple rows from database)
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Toro' ORDER BY
pd
.time
DESC LIMIT 10' at line 1Hope someone can help me to solve this , thanks in advance.