cleary1981 Posted September 1, 2008 Share Posted September 1, 2008 Hi, Thought I would post this before I start to bang my head of the table. I have a query that outputs an array from a table.The output is showing records that are no longer in the table. Even when i delete the table, these records still show. I am using php for my queries. How can I get rid of these annoying records. I think the problem may lie with query_cache but I could be wrong. Quote Link to comment Share on other sites More sharing options...
cleary1981 Posted September 1, 2008 Author Share Posted September 1, 2008 is there a command in php to flush the table or how can i disable the cache? Quote Link to comment Share on other sites More sharing options...
fenway Posted September 1, 2008 Share Posted September 1, 2008 If you deleted the table, the query cache would be purged... something else is going on. Quote Link to comment Share on other sites More sharing options...
cleary1981 Posted September 2, 2008 Author Share Posted September 2, 2008 heres my php script. When I run this directly in the browser (IE6 or Firefox) I get a list that contains records that have already been deleted. <?php require "config.php"; // array of all projects $query1 = mysql_query("SELECT DISTINCT proj_id FROM object") or die(mysql_error()); while($all = mysql_fetch_array($query1)) { $array1[] = $all['proj_id']; } // array of projects needing priced $query2 = mysql_query("SELECT DISTINCT proj_id FROM object, module WHERE object.module_name = module.module_name AND confirmed = '0'") or die(mysql_error()); while($notPriced = mysql_fetch_array($query2)) { $array2[] = $notPriced['proj_id']; } $diff = array_diff($array1, $array2); while (list ($key, $val) = each ($diff)) { echo "$val <br>"; //$q2 = mysql_query("SELECT project_name, company_name, proj_id FROM project WHERE proj_id = '$val'") or die(mysql_error()); // $row = mysql_fetch_arrayS($q2); // echo $row['company_name'] . '$' . $row['project_name'] . '$' . $row['proj_id'] . '^'; } ?> heres the output I get even if the table is deleted these records will still show 4 77 1 111 78 444 222 1004 Quote Link to comment Share on other sites More sharing options...
Hooker Posted September 2, 2008 Share Posted September 2, 2008 try looking into "reset query cache" Quote Link to comment Share on other sites More sharing options...
fenway Posted September 2, 2008 Share Posted September 2, 2008 How are you "deleting" this table? What do you get from phpmyadmin? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.