Jump to content

Zaidejas1324

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Everything posted by Zaidejas1324

  1. Hi i made a table which keeps player scores, but it is messed. Here's a link - http://kzlt.dev.lt/taure/rezultatai.php. How can i fix it ? The code: $text .= " <center><table border='1' width='565' height=30><tr><td width='15'>Nr.</td><td width='250'>&#381aid&#279jas</td><td width='150'><center>Ta&#353kai</center></td><td width='150'><center>Dalyvavo</center></td></tr>"; $result = mysql_query("SELECT * FROM taure_lentele ORDER BY score DESC"); while($row = mysql_fetch_array($result)) { if($rank == 1) { $color = "FF3300"; } else if($rank == 2) { $color = "FF6600"; } else if($rank == 3) { $color = "FF9900"; } else { $color = "FFCC00"; } $text .= '<tr bgcolor="'.$color.'"> <td width="15">'.$rank++.'</td> <td width="250"><b>'.$row['name'].'</b></td> <td width="150"><center>'.$row['score'].'</center></td> <td width="150"><center>'.$row['played'].' k.</center></td> </tr></center>'; } $text .= "</table>";
  2. Hi i got an error. I cant get $new_score and $new_played variables. $name = $_POST["name"]; $score = $_POST["score"]; $result = mysql_query("SELECT * FROM taure_lentele WHERE name='$name'"); $row = mysql_fetch_array($result); if(mysql_num_rows(mysql_query("SELECT name FROM taure_lentele WHERE name='$name'") ) == 1 ) { $old_score = $row['score']; $score + $old_score = $new_score; $old_played = $row['played']; $new_played = $old_played++; mysql_query("DELETE FROM taure_lentele WHERE name='$name'"); mysql_query("insert into `taure_lentele` set `name` = '$name', `score` = '$new_score', `played` = '$new_played"); }
  3. I need a script which will read the url. So there should be a condition which would work like this: If( url = example.com/page ){ echo"page";} else if( url =/admin ) {echo"admin";} How can i make it work ?
×
×
  • 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.