Jump to content

Problem with script


Sultani

Recommended Posts

Hi there, i have a huge problem!
My host provider have change the machine yesterday, now i get the follow error:
[code]SQL Error:
Query: SELECT * FROM games WHERE cat=\'Action\' AND id!=\'402\' ORDER BY RAND() DESC LIMIT 0, 9[/code]

The MySQL version of the old server is the same that the new server, but the php version of the old server is 4.4.4 and the new server is 5.2.0 .

I really dont know what to do.

If you guys want to see the script please go here:
http://www.scraablee.com

Just click in any game, and u will get the error.

I really need help, because my host provider dont know what to do.

Tanks in advance

btw, sorry, my english isn´t so good, im portuguese..
Link to comment
https://forums.phpfreaks.com/topic/31975-problem-with-script/
Share on other sites

[quote author=Orio link=topic=120053.msg492169#msg492169 date=1167241828]
Try replacing "!=" with "<>". (id!='402' will become id<>'402').
If that doesn't work, post the code please.

Orio.
[/quote]

Hi there, and tanks at first

I have try what u say, but in fact it dont work
Here the code from file game.php:
[code]<table width='100%' cellpadding='0' cellspacing='0'>
<tr>
  <td width='20%' valign='top' style='padding-top: 4px;'>
  <?php include "leftcolumn.php"; ?>
  </td>
  <td width='80%' valign='top' class='paddedcontent'>

<?php
 
do_event("gamepage");

$maxwidth = $games_config['maxgamewidth'];
$minwidth = $games_config['mingamewidth'];
$maxnopopwidth = $games_config['maxnopopwidth'];

$game = get_game("id="._sp($params[1])."&maxwidth="._sp($maxwidth)."&minwidth="._sp($minwidth));
$cfg['pagetitle'] = $game['name'];
$cfg['metakey'] = $game['keywords'];
$cfg['metadesc'] = $game['desc'];

$game['time'] = date("M d, Y", $game['time']);

echo "<div class='menuheadgreen'>";
echo " <div class='menuheadtext'>".$game['name']." Info</div>";
echo "</div>";
echo "<div class='menutext graymenutext'> <center>";
echo "<table width='97%' cellpadding='0' cellspacing='0'><tr><td width='50%' valign='top' align='left' class='largertext'>";
echo "<b>Added on:</b> ".$game['time']."<br />\n";
echo "<b>Play Count:</b> ".$game['playcount']."<br />\n";
echo "<b>Category:</b> <a href='".get_category_link("name=".$game['cat'])."'>".$game['cat']."</a><br />";
if ($game['type'] == 'SWF' || $game['type'] == 'DCR') {
echo "<b>File Size:</b> ".hfilesize($game['filename'])."<br />\n";
}

echo "<br /><b>Description:</b><br />";
echo $game['desc'];

if ($game['instructions'] != '') {
echo "<br /><br /><b>Instructions:</b><br />";
echo $game['instructions'];
}

if ($game['rating']!=0) {
$ratingimg = "[themedir]ratings/".round($game['rating']/2)."stars.gif";
echo "<br /><br /><b>Rating:</b><br /><img style='border: 0px; margin: 0px;' src='$ratingimg' />";
}


if (user_enabled()) {
// favorites
$user = get_logged_in_user();

if ($user!='false') {

echo "<br /><br />";

if (is_favorite($game['id'])) {
echo "<a class='darklink' href='".get_removefavorite_link("id=".$game['id'])."'>Remove From My Favorites</a><br>\n";
                                                echo "<a class='darklink' href='http://www.scraablee.com/page/24.html'>Download This Game</a><br>\n";
                                                echo "<a class='darklink' href='#1'>Put this game on your site for FREE!</a><br>\n";
       
} else {
echo "<a class='darklink' href='".get_addfavorite_link("id=".$game['id'])."'>Add To My Favorites</a><br>\n";
                                                echo "<a class='darklink' href='http://www.scraablee.com/page/24.html'>Download This Game</a><br>\n";
                                                echo "<a class='darklink' href='#1'>Put this game on your site for FREE!</a><br>\n";

}

}

}

//

echo "</td><td width='50%' valign='middle' align='center'>";


echo "<div style='padding-bottom: 4px;'>";
$adverturl=get_page_link("id=1");

if ($game['authorname'] != '') {
if ($game['authorsite'] == '') {
echo "<b>Sponsor:</b></ br> <img src='http://".$game['authorname']."' width='250' height='150' border='0'><br />\n";
} else {
echo "<b>This game is Sponsored by:</b></ br> <a href='http://".$game['authorsite']."'><img src='http://".$game['authorname']."' width='250' height='150' border='0'></a><br />\n";
}
} else if ($game['authorsite'] != '') {
echo "<b>Sponsored by:</b> </ br><a class='darklink' href='http://".$game['authorsite']."'>".$game['authorsite']."</a><br />\n";
}

if ($game['authorname']!='') {
echo "<a class='darklink' href='http://".$game['authorsite']."'>Visit our Sponsor Website</a>";
echo "<br />";
} else {
echo "<table align='center' cellpadding='0' cellspacing='0' width='250' height='150'>";
echo "<td class='gamespon' width='250' height='150' align='center' valign='bottom'>";
echo "<a class='darklink' href='$adverturl'>This Adv Spot (250x150) is Available</a>";
echo "<br /><br /><br /><br /></td></table>";

}
echo "</div>";

echo "</td></tr></table>";

echo "</center></div>";

?>

<div class='menuheadgray'>
<div class='menuheadtext'>Playing: <?php echo $game['name']; ?></div>
</div>
<div class='menutext graymenutext largertext'>
<center>

<?php
echo show_ad("id=6");
?>
<br>
<?php
if ($game['type'] != 'extlink') {
if ($game['width'] <= $maxnopopwidth) {
echo $game['code']."<br /><br />";
do_event("gameplay");
} else {
$link = get_play_link("id="._sp($params[1]));
$width = $game['width'];
$height = $game['height'];
$link = "javascript:popup('".$link."', ".$width.", ".$height.")";
echo "<b><a href=\"".$link."\" class='darklink'>- Click Here to Play ".$game['name']." in a New Window -</a></b>";
}
} else {
if (get_game_config("name=frameextlinks")==1) {
$target = "";
} else {
$target = "target='_blank'";
}

echo "<br /><b><a href=\"".get_play_link("id="._sp($game['id']))."\" class='darklink' ".$target.">- Click Here to Play ".$game['name']." -</a></b><br /><br />";
}

?>
<div align="center">
  <table width="437" height="59" border="3" bordercolor="#000000" bgcolor="#1111111111111111">
    <tr>
      <td width="423" bgcolor="#333333"><div align="center"><div align="center">
        <div align="center"><a target=_blank href="http://www.scraablee.com/sugest/tell.cgi" onclick="window.open('http://www.scraablee.com/sugest/tell.cgi?referer='+escape(window.location.href),'','width=450,height=450,status=1');return false;"><font size="3" face="Verdana, Arial, Helvetica, sans-serif"><strong><font size="2">Send
            this game to your friends!</font></strong></font></a>
            <font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong><font color="#FFFF00">|</font> <a href="javascript:Popup('http://www.scraablee.com/gamesubmit/','Popup','500','450','','front');">Upload
  your Game</a></strong>
          </font></div>
      <div align="center"><a href="#1"><img src="http://www.scraablee.com/addgame.gif" alt="Free games to your site!!" width="283" height="20" border="0"></a></div></td>
    </tr>
  </table>
</div><div class='menuheadgreen'>
<div class='menuheadtext'>If you liked <?php echo $game['name']; ?> you may also enjoy...</div>
</div>
<div class='menutext graymenutext'>
<center>

<table width='97%' cellpadding='0' cellspacing='0'><tr><td width='50%' valign='top' align='left' class='largertext'>
<?php
echo show_ad("id=8");
?>
<div class='menuheadgreen'>
<div class='menuheadtext'><span class="postbody"><a name="1"></a></span>Add this game to your site for free!</div><br>
</div>
<?php

if ((dispgamecode_enabled() && ($game['code']!='' || $game['disphtmlcode']!='')) || $game['disphtml'] == "Yes") {
if ($game['disphtml'] != "No") {

$gcode = $game['code']."<br /><center><a href='".get_home_link()."'>PLAY MORE FREE GAMES AT SCRAABLEE</a></center>";

if ($game['disphtmlcode']!='') {
$gcode = $game['disphtmlcode'];
}

echo "<b>To put this game on your blog, MySpace, HI5, or website, jut copy the code below and paste it where you want!</b><br />";
echo "<textarea rows='15' cols='55' style='font-size: 9px; font-family: Verdana;'>";
echo myhtmlentities($gcode);
echo "</textarea>";
}

}


echo "</td><td width='50%' valign='top' align='left'>";


echo "<div style='padding-bottom: 4px;'></div>";

$q = "SELECT * FROM games WHERE cat='".$game['cat']."' AND id!='".$game['id']."' ORDER BY RAND() DESC LIMIT 0, ".$themecfg['similargamesnumber']."";
$games2 = get_games("shortdesc=".$themecfg['maxdesclength']."&htmlize=true&diffquery=".$q);

foreach ($games2 as $game2) {

dispgametd(true, $game2);

}

echo "</td></tr></table>";

if (theme_is_admin()) {
echo theme_admin_link("Manage Games", "darklink", "games", "manage");
echo " - ";
echo theme_admin_link("Edit This Game", "darklink", "games", "editgame-form", "id=".$game['id']);
}

echo "</center></div>";

if (comments_enabled()) {

?>

<div class='menuheadblue'>
<div class='menuheadtext'>Comments & Ratings </div>
</div>
<div class='menutext graymenutext'>


<?php

$comments = get_comments("gid=".$game['id']);

if (count($comments)==0) {
echo "No comments yet - you can be the first!<br /><br />";
}

foreach ($comments as $comment) {

$comment['time'] = date("M jS, Y @ H:i:s", $comment['date']);

if ( !(  $user = get_user("id="._sp($comment['uid']))  ) ) {
$username = 'Guest';
} else {
if (user_enabled()) {
$username = $user['username'];
} else {
$username = 'Guest';
}
}

if ($username != 'Guest') {
$usernametext = "<a href='".get_profile_link("id="._sp($user["id"]))."' class='darklink'>".$username."</a>";
} else {
$usernametext = $username;
}

if (!user_enabled() && $usernametext=='Guest') {
echo "<b>Posted on ";
echo $comment['time']."</b>";
} else {
echo "<b>".$usernametext."</b>";
echo " - ";
echo $comment['time'];
}

if (theme_is_admin()) {
echo " - ";
echo theme_admin_link("Remove This Comment", "darklink", "comments", "delete-do", "id=".$comment['id'], true);
}

if ($comment['comment']!='') {
echo "<br />Comment: ".$comment['comment'];
}

if ($comment['rating']!=0) {
echo "<br />Rating: ".$comment['rating']."/10";
}

echo "<br /><br />";

}
echo "<table width='99%' cellpadding='0' cellspacing='0'><tr><td width='50%' valign='top' align='left' class='largertext'>";
echo "<left>Add Your Own<br />";
do_event("comment_form");
echo "</center></div>";

}


if (taf_enabled()) {

if (taf_login_required()==false || get_logged_in_user()!=false) {
echo "</td><td width='50%' valign='top' align='left' class='largertext'>";
taf_form_display(get_game_link("id=".$game['id']));
echo "</div>";

}
}

echo "</td></tr></table>";
echo "</div>"

?>
  </td>
</tr>
</table>[/code]

Tanks for trying help :)
Link to comment
https://forums.phpfreaks.com/topic/31975-problem-with-script/#findComment-148370
Share on other sites

[quote author=Crayon Violent link=topic=120053.msg492198#msg492198 date=1167243462]
the code you have provided doesn't really help as far as figuring out the problem.  Please show the code that actually sends the query.
[/quote]

hi there, the problem is solved, my host provider have the magic quotes activated, and he have put a php.ini file on my account saying that the magic quotes is off.

Tanks a lot anyway
Link to comment
https://forums.phpfreaks.com/topic/31975-problem-with-script/#findComment-148412
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.