SunQuest
 
           MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old February 16th, 2004, 06:29 AM
gurzonek gurzonek is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 3 gurzonek User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question PHP/Mysql product catalog with images

Hi guys,

IŽm planning to create a database for a product catalog
where I could also store the path of product's image. Then when I will display the catalog I will have the information of the product and the image as well.

IŽve been checking out some related articles here, but thereŽs no one where both features would be implemented at same time. Anyway if you know about one please let me know.
This are the one that IŽbeen checking out, the catalog one is ok, but the image db is made by a different way than I actually want. The idea is good, because I want a unique id for each image.

Ok, the question is the next;

Is it possible to insert products to the database and same time upload an image to the server that will be identified with the inserted product? I mean using the <?print $PHP_SELF?>
Can I do this from the same page? And then right after I insert the product and the image to the database, I want to display the inserted product information and the image to possibly modify it. I would appreciate if somebody could help me giving me some idea or advice to do this.

Thank you!

Reply With Quote
  #2  
Old February 17th, 2004, 03:05 AM
Spongy's Avatar
Spongy Spongy is offline
Alternately High
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Hilversum, Netherlands
Posts: 223 Spongy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 56 m 41 sec
Reputation Power: 5
Send a message via MSN to Spongy
Try something like this, I use it for my website to put a image with my weblog. I use the $PHP_SELF in the form, so yes, that is possible!
PHP Code:
 $logtext nl2br($logtext); // Autocreate <br />
         
if ($_FILES['userfile']['size'] == 0){
              die(
"Invalid image!"); }
         if(
is_uploaded_file($_FILES['userfile']['tmp_name'])){
             
$filename $userfile_name;
            
$filename strtolower($filename);
if(
copy($_FILES['userfile']['tmp_name'], "/var/www/images/$filename")){
$query     =    "INSERT INTO weblog VALUES ('','$date','$logtext','$title','$filename');";} 

Maybe not the best example, but I hope it's useful... I can rewrite it if you want, but I think you'll get what I mean.
Does this answer your question?
__________________
Work to live, don't live to work

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > PHP/Mysql product catalog with images


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway