Hi All..
I am new to php programming. I know how to insert and delete images in database. But I would like to know how we can modify the existed image. i.e. already image is stored in databse. Now i have to change that image say for the same user. I have tried this with UPDATE. But its taking time to load new image. I have to refresh the page many times to display changed image.
Is there any other method to modify?
Thanking all
Shailaja
2 1572
Hi All..
I am new to php programming. I know how to insert and delete images in database. But I would like to know how we can modify the existed image. i.e. already image is stored in databse. Now i have to change that image say for the same user. I have tried this with UPDATE. But its taking time to load new image. I have to refresh the page many times to display changed image.
Is there any other method to modify?
Thanking all
Shailaja
Perhaps the delay is something to do with the code you are using for the connection and the manner in which you are updating the image.
Without seeing the code no one can tell what the problem is, so post the code you are using.
Perhaps the delay is something to do with the code you are using for the connection and the manner in which you are updating the image.
Without seeing the code no one can tell what the problem is, so post the code you are using.
Thank you for your reply...
......Here is the code to update image -
# change the image
-
if (isset($_POST['change_image'])){
-
$image_id = $_POST['image_id'];
-
-
$imageUpload = $_FILES['image_2_upload']["tmp_name"];
-
$imageUpload_name = $_FILES['image_2_upload']['name'];
-
$imageUpload_type = $_FILES['image_2_upload']['type'];
-
$imageUpload_size = $_FILES['image_2_upload']['size'];
-
-
# check file was uploaded via HTTP POST
-
if (is_uploaded_file($imageUpload)) {
-
$imageHandle = fopen($imageUpload, "r");
-
$imageContent = fread($imageHandle, $imageUpload_size);
-
$imageContent = addslashes($imageContent);
-
-
$sql = "UPDATE organization_logos SET image = '{$imageContent}' ,image_type= '{$imageUpload_type}' WHERE image_id = '{$image_id}' ";
-
$result = mysql_query($sql) or die(mysql_error());
-
$num = mysql_affected_rows();
-
if ($num) {
-
header ("Location: logo_actions.php?changed=yes&org_id={$org_id}");
-
}
-
} # end if (is_uploaded_file($imageUpload))
-
else {
-
header ("Location: logo_actions.php?changed=no&org_id={$org_id}");
-
}
-
} # end if (isset($_POST['change']))
-
-
-
database connection..(include file)
-
-
<?php # Connections/web_user.php
-
/* ---------------------------------------------------------------- */
-
# general web user connection
-
-
/* ---------------------------------------------------------------- */
-
$hostname = "localhost";
-
$username = "webuser";
-
$password = "sdg7234";
-
$db_conn = mysql_connect($hostname, $username, $password) or die(error_message("dbconnect_error"));
-
?>
-
In main file... -
mysql_select_db('authentication');
-
Thank you very much..
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Ferran Foz |
last post by:
Hello,
I'm using ADODB.Stream to open a binary file on the server and write
it down to the browser using Response.BinaryWrite. It's working fine,
but i need to make some changes to the binary data before it is send
to the browser.
I'm trying to use REPLACE, but it's not finding a string that i know
it's in the binary file. Using InstrB i've found that the search
inside the binary data is being done in a Unicode format, but i don't
|
by: J. Campbell |
last post by:
OK...I'm in the process of learning C++. In my old (non-portable)
programming days, I made use of binary files a lot...not worrying
about endian issues. I'm starting to understand why C++ makes it
difficult to read/write an integer directly as a bit-stream to a file.
However, I'm at a bit of a loss for how to do the following. So as
not to obfuscate the issue, I won't show what I've been attempting ;-)
What I want to do is the...
|
by: rusttree |
last post by:
I'm working on a program that manipulates bmp files. I know the offset
location of each piece of relevent data within the bmp file. For
example, I know the 18th through 21st byte is an integer value
representing the width of the bmp image. So far, I have been able to
use fstream's seek, write, and read to pull out chucks of bytes and
convert them to usable integers straight out of the binary file. It
works well, but over the course of...
|
by: Josema |
last post by:
Hi to all,
I have stored in a database some binary files (pdfs, and gif images), i
would like to know how could i show it, in internet explorer when a person
enters for instance in a textbox the id of the file that want to view....
This is my Sql table...
ID int
File binary
|
by: AirYT |
last post by:
Hello,
Here's a quick explanation & problem:
i have an ASP (iis v5.0) application that generates a pdf file and this file
is saved to the server. it is saved in a location not available to web
users. i have an asp script (below) that sends the pdf file to the user as a
binary stream. So that the user specifies which file to upload, the script
performs some security checking and if it passes, it sends the pdf document.
| |
by: Schwarty |
last post by:
I hope I posted this to the correct group. If not, please let me know and I
will get it posted in the correct section.
I have a web application developed in ASP.NET using C# for the code behind.
I need to be able to print shipping labels from a web page within this
application. The shipping label data is pulled from a 3rd party application
and comes in binary format specific for certain brands of label printers. I
have a class library...
|
by: nguser3552 |
last post by:
Hello Everyone,
I have a problem I can't surmount, anything is gravy at this point.
I need to be able to read any type of file .ext (mov,mpeg,mp3,etc) in binary
format. I can do this in C, but have to use:
int main(int argc,char** argv)
which is archaic.
My compiler is Visual Studio 5.0 Pro.
To make my dilemma as clear as possible:
|
by: tfeller |
last post by:
I would like to drop the leading 0x on a binary value so I can do a
bitwise operation.
Here is simplified code:
select right(0x88186000,8)
I expected to get back 88186000, this was not the case. The command
returned some wierd characters.
|
by: freeurmind |
last post by:
hello everybody,
i'm trying to read binary data from an input file and store their bit by bit representation in an int array for further manipulation:
- using the file.read(buffer,1) to retrieve my first byte of data
- using unsigned char mask (for ex 0x80 = 1000 0000) i'm trying to AND it with my buffer in order to get my MSB, but i dont know how to retrieve the remaining bits. On the other hand my buffer type should it be char or unsigned...
|
by: azrael |
last post by:
Hy folks,
I googled, and searched, and can not bealive that I have not found a
built in way to convert the easy and elegant python way a function to
easily convert simple ascii data to binary and back.
I've written some my own but they were pretty slow using binascii
linbrary with hexifly and unhexifly functions conbined with a
lookuptable of binary and hex values.
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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...
|
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...
|
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,...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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
|
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...
| |