473,386 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

query cache or something else mad

178 100+
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.
Sep 1 '08 #1
5 1565
Atli
5,058 Expert 4TB
Hi.

How exactly are you executing the queries to get this data?
Could we see the code?
It wold also help to see how the table is structured.
Sep 1 '08 #2
cleary1981
178 100+
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. require "config.php";
  3.  
  4. // array of all projects
  5. $query1 = mysql_query("SELECT DISTINCT proj_id FROM object") or die(mysql_error());
  6. while($all = mysql_fetch_array($query1)) {
  7.     $array1[] = $all['proj_id'];
  8. }
  9.  
  10.  
  11. // array of projects needing priced
  12. $query2 = mysql_query("SELECT DISTINCT proj_id FROM object, module WHERE object.module_name = module.module_name AND confirmed = '0'") or die(mysql_error());
  13. while($notPriced = mysql_fetch_array($query2)) {
  14.     $array2[] = $notPriced['proj_id'];
  15. }
  16.  
  17. $diff = array_diff($array1, $array2);
  18.  
  19. while (list ($key, $val) = each ($diff)) {
  20. echo "$val <br>";
  21.  
  22. //$q2 = mysql_query("SELECT project_name, company_name, proj_id FROM project WHERE proj_id = '$val'") or die(mysql_error());
  23. //        $row = mysql_fetch_arrayS($q2);
  24. //        echo $row['company_name'] . '$' . $row['project_name'] . '$' . $row['proj_id'] . '^';
  25.  
  26.  
  27. ?>
  28.  
The table is using myISAM and is as follows;
Expand|Select|Wrap|Line Numbers
  1. CREATE TABLE `tes`.`project` (
  2. `proj_id` VARCHAR( 10 ) NOT NULL ,
  3. `project_name` VARCHAR( 50 ) NOT NULL ,
  4. `form` VARCHAR( 10 ) NOT NULL ,
  5. `access` VARCHAR( 10 ) NOT NULL ,
  6. `cable_entry` VARCHAR( 10 ) NOT NULL ,
  7. `ip_rating` VARCHAR( 10 ) NOT NULL ,
  8. `fault_rating` VARCHAR( 10 ) NOT NULL ,
  9. `company_name` VARCHAR( 50 ) NOT NULL ,
  10. `proj_manager` VARCHAR( 30 ) NOT NULL ,
  11. `deadline` VARCHAR( 10 ) NOT NULL ,
  12. PRIMARY KEY ( `proj_id` ) 
  13. ) ENGINE = MYISAM 
Sep 2 '08 #3
cleary1981
178 100+
and the output I get when I run this query as is;

Expand|Select|Wrap|Line Numbers
  1. 77 
  2. 111 
  3. 78 
  4. 444 
  5. 222 
  6. 1004 
  7.  
This is a list of project id's that fit the criteria but each one has been deleted. Even if I delete the table these records still show.
Sep 2 '08 #4
chaarmann
785 Expert 512MB
Even if I delete the table these records still show.
Maybe you forgot to "commit" and/or close the current connection after deleting the table. Then your program of course still sees the old data.

If not,then just figure out where the old data is cached.
After deleting the table and restarting the database, is it still there when inquiring again? Then it's cached somewhere inside your apache/php.
After deleting the table and restarting your apache/php, is it still there when inquiring again? Then it's cached somewhere inside the database.

After figuring that out, we can help you more.
Sep 2 '08 #5
cleary1981
178 100+
Silly me. I was working of the wrong table. The child table still had the proj_id fields in it. Duh!

Thanks anyway
Sep 2 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Phil Powell | last post by:
I created a page that will be doing image resizing and manipulation, which seems to work (using GD library). However, upon returning to the page where the image has been changed, I still see the...
2
by: jaysonsch | last post by:
Hello! I am having some problems with a database query that I am trying to do. I am trying to develop a way to search a database for an entry and then edit the existing values. Upon submit, the...
1
by: steve | last post by:
Does SQL Server have a query cache similar to mysql, whereas the query result is cached, if the table has not been changed? If so, please refer me to more info. Thanks. --...
4
by: Jim Owen | last post by:
I am storing all my application data in the application cache. Anytime I have a method as part of an asp.net form, I need to access the objects in the cache. The only way I can think of to do this...
2
by: Don | last post by:
I've come across a weird behaviour with regards to the cache object. I couldn't find any documentation which could explain this. Basically the problem has to do with the cache item NOT expiring....
17
by: NeoAlchemy | last post by:
I am starting to find more web pages that are using a query parameters after the JavaScript file. Example can be found at www.opensourcefood.com. Within the source you'll see: <script...
1
by: Don Li | last post by:
Hi, Env: MS SQL Server 2000 DB Info (sorry no DDL nor sample data): tblA has 147249 rows -- clustered index on pk (one key of datatype(int)) and has two clumns, both are being used in joins;...
2
by: =?Utf-8?B?Y2F0?= | last post by:
We recently moved an older ASP.NET 1.1 code base on to ASP.NET 2.0, .NET 3.0 and Windows 2003 Server SP2. We started experiencing the following issue with the web cache (the code is straightforward...
2
by: mndprasad | last post by:
Hi friends, Am new to AJAX coding, In my program am going to have two texbox which going to implent AJAX from same table. One box is going to retrieve the value of other and vice...
2
by: buzzy18 | last post by:
Hi all, I am using CakePHP to develop a bidding site. I have created a controller called 'daemons' and it performs 4 different tasks which I need to run continuously on the server every minute. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.