954,576 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to edit records with images?

hi every! im a newbie and im stocked with some edit codes,. can u make me a code on how to edit records with images? i really need it now. If u can, then it is very much appreciated.


here is my database and table
CREATE DATABASE db1;

CREATE TABLE IF NOT EXISTS tb_product;
(

product_id int(20) NOT NULL AUTO_INCREMENT,
product_name varchar(50) NOT NULL,
product_image varchar(50) NOT NULL,
product_desc varchar(50) NOT NULL,
product_price int(20) NOT NULL,
product_quantity int(20) NOT NULL,
product_status enum('Available','Not Available') NOT NULL DEFAULT 'Available',
date_added timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
category_id int(20) NOT NULL,
PRIMARY KEY (product_id),
KEY category_id (category_id)
) ENGINE=MyISAM;

------------------here are my form for adding the products;---------
<?php
if(isset($_GET['err2']))
{
if($_GET['err2']==1)
echo '
Please enter data in all fields.


';
else ($_GET['err2']==3)
echo '
Book already exists!


';
}
?>

Image:

Name:

Description:

Price:

Quantity:

Status:


AvailableNot AvailableCat ID:


RomanceSci-FiComedyHorror

-----------------please, i really need the codes--------------

banmikko
Newbie Poster
10 posts since Feb 2011
Reputation Points: 10
Solved Threads: 0
 

What do you mean by edit records with image?

cossay
Junior Poster
128 posts since Nov 2010
Reputation Points: 17
Solved Threads: 22
 

im already done with the add products script,. what i wanted now is to make a code which i can be able to edit those records that i added including the image.

banmikko
Newbie Poster
10 posts since Feb 2011
Reputation Points: 10
Solved Threads: 0
 

Do you mean that you want to show the image in your form?

smantscheff
Nearly a Posting Virtuoso
1,233 posts since Oct 2010
Reputation Points: 300
Solved Threads: 254
 

the image is already shown when i view it from my viewproducts script, the problem is how i could modify the records including the image. how could i update it?

banmikko
Newbie Poster
10 posts since Feb 2011
Reputation Points: 10
Solved Threads: 0
 

Use the mysql UPDATE statement.

smantscheff
Nearly a Posting Virtuoso
1,233 posts since Oct 2010
Reputation Points: 300
Solved Threads: 254
 

i tried it though but it didnt, i thought ive got a problem with the target_path. what do you think?

banmikko
Newbie Poster
10 posts since Feb 2011
Reputation Points: 10
Solved Threads: 0
 

Show your update query.

smantscheff
Nearly a Posting Virtuoso
1,233 posts since Oct 2010
Reputation Points: 300
Solved Threads: 254
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: