Jump to content

php mysql query cache problem


rabn21

Recommended Posts

Hi, im having a problem with my wamp server. I have a page that loads in player objects in a list from a mysql database using php. It reads the players in fine, however when I use the part of that page to add a new player and then call the function that loads the players in it does not recognise the new player. If I close down the browser and reopen the page in a new browser window the new player loads in fine.

 

Im thinking this is a cache problem. I have tried using a no cache query and still no luck this is driving me insane. I have included the code below. If anyone has any suggestions on how to solve this cache problem or if you think it may be a different problwm can you let me know please. Any help would be much appreciated.

 

Here is the php code

<?php

$teamID = $_GET["ti"];

$con = mysql_connect("localhost","rabn21","twolves21");

if (!$con)
   {
    die('Could not connect: ' . mysql_error());
   }

mysql_select_db("blms", $con);

$result = mysql_query("SELECT SQL_NO_CACHE * FROM players");

echo "<ul>";

while($row = mysql_fetch_array($result))
   {
    if($row['teamID'] == $teamID)
  {
   echo "<li><div class='player' id='p" . $row['playerID'] . "' onclick='javascript:getPlayerDetails(this);'>";

   echo $row['fName'] . " " . $row['sName'];

   echo "</div></li>";
  }
   }

echo "</ul>";

mysql_close($con);
?>

I hope that I have posted this in the right place. Can anyone help? 

Link to comment
https://forums.phpfreaks.com/topic/49654-php-mysql-query-cache-problem/
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.