473,405 Members | 2,421 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,405 software developers and data experts.

Database getting updated twice

Hey all,

Another question for you.

I have a script that reads in a row from my db into an image object
which i defined. It then takes that image and generates a thumbnail by
using an output buffer and writes the thumbnail to a new entry in the
database. Finally it prints the new image to the screen via this
method:

header("Content-type: ".$image->GetFileType());
header("Content-length: ".$this->GetFileSize());
echo $this->GetImageContent();

where GetImageContent returns the binary data contained in the image.

This all seems to work, but when it hits the first header line
header("Content-type: ".$image->GetFileType());

it adds a second entry into the database. Basically im ending up with 2
identical records.

Ive been trying to figure out how to work around this, and the only
thing i could think of was that because im calling to header the script
is getting executed twice. No where in my print function so i have a
call to save so my question i suppose is, is it possible for a script
to execute a second time because of a call to header?

Apr 17 '06 #1
2 1179
Areric wrote:
Hey all,

Another question for you.

I have a script that reads in a row from my db into an image object
which i defined. It then takes that image and generates a thumbnail by
using an output buffer and writes the thumbnail to a new entry in the
database. Finally it prints the new image to the screen via this
method:

header("Content-type: ".$image->GetFileType());
header("Content-length: ".$this->GetFileSize());
echo $this->GetImageContent();

where GetImageContent returns the binary data contained in the image.

This all seems to work, but when it hits the first header line
header("Content-type: ".$image->GetFileType());

it adds a second entry into the database. Basically im ending up with 2
identical records.

Ive been trying to figure out how to work around this, and the only
thing i could think of was that because im calling to header the script
is getting executed twice. No where in my print function so i have a
call to save so my question i suppose is, is it possible for a script
to execute a second time because of a call to header?


So, what does your GetFileType() function do?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 17 '06 #2
just returns $this->mFileType; where mFileType is a string value along
the lines of "image/jpeg"

Apr 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: lawrence | last post by:
A very strange bug. www.monkeyclaus.org is run by a cms I'm developing. One of types of users we allow is "justTestingTheSite", a type of user I developed to give demo's to prospective clients. The...
10
by: Preston Crawford | last post by:
I'm looking to learn ASP.NET better and thinking about helping my church put together a website in order to do this. They need the help, I'd like the training, so I'm thinking of going this route...
2
by: Bill Moran | last post by:
Hello again, I'm developing a program based on PostgreSQL. It's consists of tables, constraints, _many_ stored procedures, 56M of test data, and a client app written in C. To help me with...
25
by: Colin McKinnon | last post by:
Hi all, There's lots of DB abstraction layers out there, but a quick look around them hasn't turned up anything which seems to met my requirements. Before I go off and write one I thought I'd...
8
by: rdemyan via AccessMonster.com | last post by:
Anyone have any ideas on how to determine when the back-end file (containing only tables) has been updated with new data. The date/time of the file won't work because it gets updated to the...
2
by: Sue | last post by:
Hi, we are thinking of installing sql server as a backend to our website. Q.1. What is the best way to do this - should we host the database on the same IIS server where the website is hosted,...
2
by: =?Utf-8?B?SGV6YWw=?= | last post by:
Hi, I am trying to add a new record to a table but everytime I click the button, somehow it saves the record twice... I've created a stored procedure to insert records into a table and I called...
2
by: CommonElements | last post by:
Hi, 1. I am using Visual Studio.NET 2005 C# Win Form 2. I have setup a database connection to my Access Database using ADO.NET 3. On my system timer I have the following code to execute every 1...
0
MrMancunian
by: MrMancunian | last post by:
How to create a database connection without using wizards Introduction I've seen a lot of questions on the net about getting data from, and saving data to databases. Here's a little insight how...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
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
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
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
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...

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.