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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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