473,473 Members | 2,138 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

PHP/Apache eating up hard-drive memory

110 New Member
Hi Gang,

I've run into a serious problem, and can't seem to find the issue in my somewhat simple code.
I've got a database and I update it with concert listings.
I need to check if the new updates are already in the db, and the code I have is currently a mess so I decided to try using array_diff to find the new vs. old shows.

Getting the list of updates into an array is no problem, but getting the list of shows from my db into array format so that I can compare the two is proving to be quite difficult.

I've pinned down the error to be somewhere in the following code, but I can't seem to see anything that would cause anything to be written to my drive.

I'd point to the dev code, but that would kill my 'puter, so I can't do that.
The sql executes flawlessly and quickly, so that is not the answer.

However, the page will never finish loading.
Expand|Select|Wrap|Line Numbers
  1.  
  2.     $resultShowExist = mysql_query($doesShowExist) or die('could not find if show exists');
  3.  $showsListFromDb=array();
  4.  while($checkShowExist = mysql_num_rows($resultShowExist)){
  5.         $showTitle=$checkShowExist['title'];
  6.         $showAddress=$checkShowExist['address'];
  7.                 $showCity=$checkShowExist['city'];
  8.         $showState=$checkShowExist['state'];
  9.         $showZip=$checkShowExist['zip'];
  10.         $showDate=$checkShowExist['date'];
  11.         $showTime==$checkShowExist['time'];
  12.             $mysqlShowsToArray=$showDateTime .' '. $showTime.','. $showTitle.','. $showAddress.','. $showCity.','. $showState.','. $showZip;
  13.  echo $mysqlShowsToArry.'<br>'; 
  14.  array_push($showsListFromDb, $mysqlShowsToArray);
  15.  
  16.  
  17.  
  18.   }
  19. echo"shows List from DB <br>";
  20.   print_r($showsListFromdb);
  21.  
Sep 29 '08 #1
2 1458
Atli
5,058 Recognized Expert Expert
Hi.

I would guess the problem is on line 4, where you create a while loop using the mysql_num_rows function as the condition. The function is always checking how many results your query returned, which never changes, causing an indefinite loop.

I'm pretty sure you were meaning to use mysql_fetch_array.
Sep 29 '08 #2
pedalpete
110 New Member
Damn my eyes!!!

You are a good man Atli,
thank you once again.


Hi.

I would guess the problem is on line 4, where you create a while loop using the mysql_num_rows function as the condition. The function is always checking how many results your query returned, which never changes, causing an indefinite loop.

I'm pretty sure you were meaning to use mysql_fetch_array.
Sep 29 '08 #3

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

Similar topics

20
by: White Wolf | last post by:
Hi, I am looking for some sort of easy-to-install binary package to get an environment ready for PHP development on XP. I am starting the development of a site, starting with learning PHP and...
2
by: John Murtari | last post by:
Folks, We are slow in rolling out PHP 5 to our users because it won't live as a module with PHP 4 in Apache 1.3.x/Linux. I have seen many workaround like running it as CGI or using a reverse...
1
by: J Peaks | last post by:
All, We are soon to be hosting a very important system but are currently having some problems with setting this up on our Redhat Linux environment. We are running the following: Redhat 9...
0
by: Kevin Sagon | last post by:
I am running a J2EE Web App under Tomcat 4.1 with Apache 2.0 proxying requests. Everything is configured and working appropriately however I ran into a problem after configuring J2EE Form...
2
by: Wolter Kamphuis | last post by:
Hi all, I've got a question, not really about PHP but this is the best audience. Is anybody aware of problems with Internet Explorer not sending any get/post/cookie data? I'm the webmaster of...
18
by: Randell D. | last post by:
Folks, This must get asked reasonably often however I've had tried viewing groups.google.com and the apache/php web pages and not found a specific answer. Basically, is Apache 2 officially...
5
by: mariosp | last post by:
Hello, Thanks to all for your answers to my previous topic. I decide to install and configure both services on the same 2003 Server. Is that possible or I will crash it? Thanks again. ...
12
by: David T. Ashley | last post by:
I've noticed that some scripting languages (PHP, for example) have options to control whether the script can be terminated by the user clicking STOP on their browser (or similar mechanisms). How...
2
by: comp.lang.php | last post by:
I have an app that is going berzerk on its own; without any code or environmental changes of any kind, for some bizarre reason it will randomly just hang, spawn multiple Apache processes and...
2
by: kellygreer1 | last post by:
Sorry for the crosspost, but I thought some of the PHP folks might also be able to help. Can anyone point me in the right direction for NT Authenticating on Apache running on Windows? I see many...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.