473,605 Members | 2,214 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is this php script going run into memory problems?

290 Contributor
Hi,

I am using the following code to get an updated version of
my main data table but I am concerned that the processor will
run out of memory.

Since the result will be help in an array i.e. in memory is this
any concern ?

This is the code:

Expand|Select|Wrap|Line Numbers
  1. $sql = "SELECT cb_last.*, cb_prev.* FROM cb_last LEFT JOIN cb_prev ON cb_last.id=cb_prev.id WHERE cb_last.day_no = '$dayno' ORDER BY cb_last.id";
  2. $result = mysql_query($sql)
  3.     or die("could not JOIN cb_last AND cb_prev". mysql_error());  
I am also not sure if I can use the WHERE clause when joining to tables ??
Jan 12 '10 #1
2 1396
dgreenhouse
250 Recognized Expert Contributor
If the table has a lot of records, your script will probably run out of memory if you saved the results in an array.

The results set (i.e. the $rs in $rs = mysql_query($sq l)) is just a pointer and won't cause a memory fault. Otherwise, you wouldn't be able to perform a selection on multi-mega record tables. That's where the mysql_fetch_??? ? commands come into play.

As long as you don't try to save store the contents in memory, you shouldn't run into a problem.
Jan 12 '10 #2
jeddiki
290 Contributor
Thanks,

I suspected that mysql must be handling the memory/disc side of things
as I know thtere are huge databases being run on it !
Jan 12 '10 #3

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

Similar topics

13
1839
by: Ideasman | last post by:
Hi I have a made a script that process normals for a flat shaded 3D mesh's. It compares every vert with every other vert to look for verts that can share normals and It takes ages. I'm not asking anyone to rewrite the script- just have a look for any stupid errors that might be sucking up time.
11
2818
by: Wentink | last post by:
Does anybody have a simple script that let's me popup a picture from a thumbnail? The ones i found are all very very complicated and messy in the source... Thanks, Tintin
3
1793
by: #pragma once | last post by:
That's all we are expecting from programs written in the managed code; Though a MVP advised not to say that, because after JIT compilation the code runs in the native! Funny, isn't? That means scripting languages run in the Host code and never in the native? That means scripting languages are poorer than .NET in speed just because they are hosted by an interpreter? What about .Net run time libraries? Can any one tell me the differences?...
0
1373
by: Mike G | last post by:
Hi - I support a web application that contains many ASP's. Periodically, the DLLHOST.EXE running this app (we have it in High protection) will start taking alot of time (consistently between 30 and 60% in Task Manager), and the number of threads increases, and the memory in use goes up. I have started looking at the performance monitor, and note under Active Server Pages there is a counter "Request Execution Time". I notice that...
0
3221
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs converted/developed with VB.NET. What I want from debugging is to be able to step into the methods in the DLLs called from ASP scripts using Visual Studio .NET. Background: For typical script debugging issues, you can read and follow the two documents on...
12
2978
by: tshad | last post by:
I am not sure why I am getting this error: I have the following code I want to run from another include file that holds all my functions. functions.inc ************************************************************************************ <Script runat="Server"> Sub fnHeader(client As String) response.write("<!-- #include file = ../includes/staffingHeaders.inc -->")
10
1808
by: Jerim | last post by:
I am attempting to put together one script that pulls data from one database on its own server, and data from another database on its own server, which is off-site. Server 1 - Only allows shared memory access to the database. Also disallows http:// includes. This is where the database of names is stored. This is our internal MySQL server. Server 2 - Only allows shared memory access to the database. So anything that calls the...
15
3235
by: Lawrence Krubner | last post by:
Does anything about this script look expensive, in terms of resources or execution time? This script dies after processing about 20 or 25 numbers, yet it leaves no errors in the error logs. This is on a server that handles a fairly demanding site. The defaults, in php.ini, have all been cranked fairly high: scripts get 180 seconds to run, and they can have as much as 256 megs of RAM. The input for this script is coming from a textarea in...
1
47434
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script. What You Need Any recent...
0
8007
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
8428
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...
1
8076
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
6749
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5889
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5446
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3913
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...
1
2438
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
1
1546
muto222
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.