say whaaa? Php issue.
#1
Posted 27 September 2006 - 02:52 PM
http://www.sfegaming...arcade/beta.php
Notice the whole "Resource id #13"
Anyone got any clues?
I have never come accross anything like this before.
Please help:)
Thanks.
Henry.
#2
Posted 27 September 2006 - 02:56 PM
Matt
#3
Posted 27 September 2006 - 03:05 PM
#4
Posted 27 September 2006 - 03:08 PM
class bleh{ }
$myClass = new bleh;
echo $myClass;
#5
Posted 27 September 2006 - 03:10 PM
Oh. well you've done xyz.
Lets go get our code:D
<?php
include_once "conn.php";
$last = $totalrows - 10;
$last5 = $totalrows - $last;
$quer = "SELECT * FROM games WHERE (sender is NULL OR sender = '') ORDER BY score DESC LIMIT $last5";
$result = mysql_query($quer,$db) or die("Error: " . mysql_error());
$datas = mysql_fetch_array($result);
$quer = "SELECT SUM(rate) as total_rate, gName,catid FROM komento WHERE sender <> 'video' GROUP BY gName,catid ORDER BY total_rate DESC LIMIT $last5";
$result = mysql_query($quer,$db) or die("Error: " . mysql_error());
$datas = mysql_fetch_array($result);
echo "<table width=100%>";
do {
$fname = str_replace(" ","-",$datas[gName]);
echo "<tr style='font-size:8pt'><td><a href = '$siteurl/game/$datas[catid]/$fname.html'>".substr($datas[gName], 0, 20)."</a> </td><td align=right> $datas[total_rate]/10</td></tr>";
}
while ($datas = mysql_fetch_array($result));
echo "</table>";
?>
Thats the page the codes on, I use some includes on the index page to grab that and other things.
Thanks again:)
#6
Posted 27 September 2006 - 03:12 PM
Example:
$sql = "SELECT * FROM table"; $sql = mysql_query($sql); echo $sql;
Try this:
$sql = "SELECT * FROM table";
$sql = mysql_query($sql):
While ($row = MySQL_fetch_array($sql)){
echo $row['field_name'];
}
Edited by Lang, 27 September 2006 - 03:12 PM.
#7
Posted 27 September 2006 - 03:31 PM
#8
Posted 27 September 2006 - 03:43 PM
#9
Posted 27 September 2006 - 03:49 PM
Davey, on Sep 27 2006, 02:05 PM, said:
cheerio, on Sep 27 2006, 02:08 PM, said:
class bleh{ }
$myClass = new bleh;
echo $myClass;$obj = new class; echo $obj; /* == Object; !is_resource($obj); */
influct, on Sep 27 2006, 02:10 PM, said:
Oh. well you've done xyz.
Lang, on Sep 27 2006, 02:12 PM, said:
<?php
include_once "conn.php";
echo 'Resource error is in the config if above this line...'; /* Just an error check... */
$last = $totalrows - 10;
$last5 = $totalrows - $last;
$result = mysql_query("SELECT SUM(rate) as total_rate, gName,catid FROM komento WHERE sender <> 'video' GROUP BY gName,catid ORDER BY total_rate DESC LIMIT $last5", $db) or die("Error: ".mysql_error());
echo "<table width=100%>";
while ($datas = mysql_fetch_array($result)){
$fname = str_replace(" ","-",$datas['gName']);
echo "<tr style='font-size:8pt'><td><a href = '$siteurl/game/{$datas['catid'}]/$fname.html'>".substr($datas['gName'], 0, 20)."</a> </td><td align=right> {$datas['total_rate']}/10</td></tr>";
}
echo "</table>";
?>
That shouldn't fix the problem, but it removed a lot of junk.
Edited by rc69, 27 September 2006 - 03:50 PM.
#10
Posted 27 September 2006 - 04:03 PM
That cleared lots of the junk that was affecting things:S
Sadly I'm getting more errors:S
This is madness, I'm going to recode this from scratch...
(wanders of mumbling bitchy comments about the folks that scripted this in the first place)
#11
Posted 27 September 2006 - 04:08 PM
Matt.
Edited by Matthew., 27 September 2006 - 04:09 PM.
#12
Posted 27 September 2006 - 04:19 PM
Thanks guys, you'll notice I borrowed your code:)
Big thanks to rc69 for helping me by cleaning the code:)
<?php
include_once "conn.php";
$last = $totalrows - 10;
$last5 = $totalrows - $last;
$sql = mysql_query("SELECT SUM(rate) as total_rate, gName,catid FROM komento WHERE sender <> 'video' GROUP BY gName,catid ORDER BY total_rate DESC LIMIT $last5");
$sql2 = mysql_query($sql);
While ($row = MySQL_fetch_array($sql)){
echo
$row['gName']
;
}
?>
He, my finished product;)
#13
Posted 27 September 2006 - 04:42 PM
#14
Posted 28 September 2006 - 06:10 PM
<?php
include_once "conn.php";
$last = $totalrows - 10;
$last5 = $totalrows - $last;
$sql = mysql_query("SELECT SUM(rate) as total_rate, gName,catid FROM komento WHERE sender <> 'video' GROUP BY gName,catid ORDER BY total_rate DESC LIMIT $last5") or die(mysql_error());
while($row = mysql_fetch_array($sql)){
echo $row['gName'];
}
?>
#15
Posted 30 September 2006 - 08:43 AM
Thanks for the error reporting idea:)
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
