473,811 Members | 3,424 Online
Bytes | Software Development & Data Engineering Community
+ 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 1475
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_arr ay.
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_arr ay.
Sep 29 '08 #3

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

Similar topics

20
1976
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 design etc. The final site will run on some sort Linux/*nix, but for the purpose of the first development phase I will have to use Windows. I know the FoxServ package, but it seems to be very slowly updated. I saw
2
1796
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 proxy to forward php 5 requests to another server. Any 'php gods' out there who might know how hard that support would be to add to a future version of PHP 5, like PHP 5.1. I'm sure we are not the only hosting provider running into a problem with...
1
2917
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 (all updated using up2date) kernel 2.4.20-20.9 Apache 2 (specifically 2.0.40-21.5, the current default for Redhat 9) Tomcat 4 (I do not know exactly which version, this has been installed on
0
3296
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 Authentication. I have a security constraint restricting access to the application so that when I attempt to access the app I am redirected to the login page. This works as expected both when accessing the application via the Apache proxy or hitting...
2
1690
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 a large webbased administration package. Recently we get complaints from our customers about them losing their session. After adding extra debugging code we see that a small number of apache requests provide no GET, POST or COOKIE data. This...
18
1710
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 supported with PHP, and if so, which version of PHP? The last I heard the PHP website had Apache 2 with PHP4 running for
5
2772
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. ***Taking into consideration I want to inastall php and mysql on both
12
3278
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 does this apply to CGI-BINs? Can Apache ever try to terminate a CGI-BIN, or does it just keep running and its output is discarded? Is there any signalling?
2
2539
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 completely ignore max_execution_time, literally running infinitely. Using PHP 5.2.0, Apache 1.3 and Win XP Is this normal "bizarre" behavior that can occur within this setup; if so, what workarounds have you found to combat this, other than the...
2
1597
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 links around the web... but hard to separate whats good from whats older and unmaintained. Thanks, Kelly Greer kellygreer1@nospam.com
0
9730
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10651
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10392
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10403
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10136
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5555
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5693
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4341
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3020
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.