Jump to content

almightyegg

Members
  • Posts

    791
  • Joined

  • Last visited

Everything posted by almightyegg

  1. It's still not doing anything and has a little error exclaimation mark in the corner <script type="text/JavaScript"> function timedRefresh(timeoutPeriod) { setTimeout("window.location="http://www.lordoftheabyss.com/chat/index.php";",timeoutPeriod); } </script>
  2. <script type="text/JavaScript"> function timedRefresh(timeoutPeriod) { setTimeout("window.location(true);",timeoutPeriod); } </script> it doesn't change now...
  3. <script type="text/JavaScript"> function timedRefresh(timeoutPeriod) { setTimeout("location.reload(true);",timeoutPeriod); } </script> </head> <body bgcolor="black" onload="JavaScript:timedRefresh(5000);">
  4. I have a page that automatically refreshes every 5 seconds, and you can post things on this page. Clearly that $_POST information will be processed again and again... how would I go about deleting it? I tried this if(isset($_POST[message])){ $insert = mysql_query("INSERT INTO chat (`userid`, `message`) VALUES('{$mem['id']}', '{$_POST['message']}')") or die(mysql_error()); unset($_POST[message]); }
  5. You're gonna hate me... I have another problem :s How would I take one timestamp from another? $time1-$time2= X seconds
  6. Thank you, also how would I get the difference between 2 timestamps? As in which one is bigger... I tried: if($time1>$time2){ }else{ } but no joy
  7. How would add a certain amount of seconds to a date defined by date()? Eg. current time by server is 2009-02-26 22:05:09 how would I get 2009-02-26 22:05:39??
  8. I know have 108.411944095 hehe, how would I change it to 2 dp?
  9. is there any way to get a random value with decimals?? eg. rand(45.21, 56.89) = 51.34
  10. Hmm... well it inserts correctly into one table (table 1) but it has a 0 value in table 2.... $newid = mysql_insert_id(); $insert = mysql_query("INSERT INTO log (`id`, `userid`) VALUES('$newid', '{$mem['id']}')") or die(mysql_error()); $insert2 = mysql_query("INSERT INTO fishlog (`fish`, `logid`) VALUES('{$fish['code']}', '$newid')") or die(mysql_error());
  11. I wat to create 2 tables in the same page, they are connect so that the ID of table 1 is a foreign key in table 2 Because of this I need to code the new id in rather than auto_increment so I can place it in the table 2 when creating it. I've tried to do this: $maxid = mysql_query("SELECT max(id) FROM log"); $newid = $maxid+1; $insert = mysql_query("INSERT INTO log (`id`, `userid`) VALUES('$newid', '{$mem['id']}')") or die(mysql_error()); $insert2 = mysql_query("INSERT INTO fishlog (`fish`, `logid`) VALUES('{$fish['code']}', '$newid')") or die(mysql_error()); Only problem is $newid is always 16? Despite it being the first row it's 16.... then the second time it says multipul value of 16, so what do I do???
  12. when removing the included file there was no change... After doing some more error checking the error is in another line further down the page :-S $sql = "SELECT * FROM topics WHERE fid = '$f' AND pinned = 'No' AND rid = '0' AND deleted = 'No' order by updatetimestamp desc LIMIT $startval,$maxposts"; $result2 = mysql_query($sql) or die("SQL Was(result2): " . $sql . "<br />Error returned: " . mysql_error()); This shows: SQL Was(result2): SELECT * FROM topics WHERE fid = 'ghel' AND pinned = 'No' AND rid = '0' AND deleted = 'No' order by updatetimestamp desc LIMIT 0, Error returned: 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 '' at line 1
  13. <? $result = mysql_query("SELECT * FROM forums where board = '$f'"); $r = mysql_fetch_array($result); $sql = "SELECT * FROM topics WHERE fid = '$f' AND pinned = 'Yes' AND rid = '0' AND deleted = 'No' order by updatetimestamp desc"; $result3 = mysql_query($sql) or die("SQL Was(result3): {$sql}<br />Error returned: " . mysql_error()); $forum_title = $r['title']; ?><center> <table border="0" width="70%"><tr><td> Welcome to the Game Help Forum, and probably the game entirely! If you are a having problems locating or understanding things please look at the <a href="/helpfiles">Help Files</a> before posting here otherwise the Forum will be spammed to the brim!</td></tr></table><br><br> </centeR> <table cellpadding="5" cellspacing="0" border="0" style="width:600px;border:1px solid #000;"> <tr style="background-color:#222;"> <td style="width:47%;background-color:#222;">Thread</td> <td style="width:12%;background-color:#222;">Replies</td> <td style="width:12%;background-color:#222;">Views</td> <td style="width:29%;background-color:#222;" rowspan=100 valign=top> <? if($mem[mod] == Yes){ echo "Mod Actions"; }else{} ?></td> </tr> <? include "bbcodes.php"; while($r3 = mysql_fetch_array($result3) or die("SQL Was(r3): " . $sql . "<br />Error returned: " . mysql_error())){ $id = $r3[id]; $title = $r3[title]; $username = $r3[username]; $sql = "SELECT * FROM topics WHERE `pid` = '$id' AND`fid` = '$f'"; $balala = mysql_query($sql) or die("SQL Was(balala): " . $sql . "<br />Error returned: " . mysql_error()); $replies = mysql_num_rows($balala); $views = $r3[views]; $view2 = mysql_query("SELECT * FROM users WHERE username = '$username' LIMIT 1"); $userid = mysql_fetch_array($view2); if($userid[admin] == "Yes"){ $woot = "<font color=\"#FF0000\"><b>$userid[admintitle] $username</b></font>"; }elseif($userid[mod] == "Yes"){ $woot = "<font color=\"#0000FF\"><b>Moderator $username</b></font>"; }else{ $woot = "<font color=\"#$userid[usernamecolor]\">$username</font>"; } $title2 = preview($r3['post']); ?> <tr> <td style="width:250px;background-color:#101010;"> PINNED: <a href="viewthread.php?f=<? echo "$f"; ?>&t=<? echo "$id"; ?>" title="<? echo "$title2"; ?>"><? echo "$title"; ?></a><br><a href="http://www.lordoftheabyss.com/player/view.php?id=<? echo "$userid[id]>$woot</a>\""; ?> </td> <td style="width:75px;background-color:#101010;"><? echo $replies; ?></td> <td style="width:75px;background-color:#101010;"><? echo $views; ?></td> </tr> <tr> <? }
  14. I found a line where it shows anerror: while($r3 = mysql_fetch_array($result3)){ when replacing it with: while($r3 = mysql_fetch_array($result3) or die("SQL Was(r3): " . $sql . "<br />Error returned: " . mysql_error())){ I get: SQL Was(r3): SELECT * FROM topics WHERE fid = 'ghel' AND pinned = 'Yes' AND rid = '0' AND deleted = 'No' order by updatetimestamp desc Error returned:
  15. I made all of the changes you requested and I get: 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 '' at line 1 This must mean the error is elsewhere?
  16. Made no difference - the error still shows the same: 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 '' at line 1 The error comes after the $result3 query because other things have been successfully echoed after this point. But this is it anyway: $result3 = mysql_query("SELECT * FROM topics WHERE fid = '$f' AND pinned = 'Yes' AND rid = '0' AND deleted = 'No' order by updatetimestamp desc"); I have checked $f has a value $id should get a value during the loop, comes directly from a database
  17. Long time no speak. I have a problem, I opened my page and it's told me I have incorrect syntax: 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 '' at line 1 It's not being very helpful at telling me where abouts it is at - but I've managed to pin point it to within this code: while($r3 = mysql_fetch_array($result3)){ $id = $r3[id]; $title = $r3[title]; $username = $r3[username]; $balala = mysql_query("SELECT * FROM topics WHERE `pid` = '$id',`fid` = '$f'") or die(mysql_error()); $replies = mysql_num_rows($balala); $views = $r3[views]; $view2 = mysql_query("SELECT * FROM users WHERE username = '$username' LIMIT 1"); $userid = mysql_fetch_array($view2); if($userid[admin] == "Yes"){ $woot = "<font color=\"#FF0000\"><b>$userid[admintitle] $username</b></font>"; }elseif($userid[mod] == "Yes"){ $woot = "<font color=\"#0000FF\"><b>Moderator $username</b></font>"; }else{ $woot = "<font color=\"#$userid[usernamecolor]\">$username</font>"; } $title2 = preview($r3['post']); ?> <tr> <td style="width:250px;background-color:#101010;"> PINNED: <a href="viewthread.php?f=<? echo "$f"; ?>&t=<? echo "$id"; ?>" title="<? echo "$title2"; ?>"><? echo "$title"; ?></a><br><a href="http://www.lordoftheabyss.com/player/view.php?id=<? echo "$userid[id]>$woot</a>\""; ?> </td> <td style="width:75px;background-color:#101010;"><? echo $replies; ?></td> <td style="width:75px;background-color:#101010;"><? echo $views; ?></td> </tr> <tr> <? } Sorry for the scruffy coding, and odd variable names Any help would be greatly received
  18. And the comma after the last value. Just copy and past that it and see if you get any more errors
  19. mysql_query("INSERT INTO myscore2 (name, score, gameid, mode, thedate, thetime) VALUES('" . mysql_real_escape_string(substr($_GET['name'], 0, 13)) . "', '" . mysql_real_escape_string($_GET['score']) . "', '" . mysql_real_escape_string($_GET['gameid']) . "', '" . mysql_real_escape_string($_GET['mode']) . "', '" . mysql_real_escape_string('{$today}') . "', '" . mysql_real_escape_string('{$time}') . "', '" . mysql_real_escape_string('{$ip}') . "')") or die(mysql_error()); Try that
  20. I might have miss understood what BlueSkyIS said then... Not if what you just posted is your current code. What havn't I done? Or what have I done wrong?
×
×
  • 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.