473,511 Members | 10,700 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 1388
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($sql)) 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
1827
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...
11
2808
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
1778
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...
0
1367
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...
0
3204
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...
12
2969
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...
10
1796
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...
15
3228
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...
1
47354
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...
0
7251
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,...
0
7148
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
7367
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
5673
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,...
1
5072
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...
0
4743
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...
0
3217
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
790
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
451
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...

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.