PHP/MYSQL - Image

Associate
Joined
14 May 2008
Posts
130
Hi, was wondering if someone can direct me on how i can do this if possible as im looking to update my mother in laws as a semi xmas gift and so its a tad easier for her to manage (and i get a lot of calls from her too =p)

Basically i was wondering how i would go about storing an image in a mysql db, i know how to upload it to a server etc where it would be stored but no idea how to save the image path to the db or how to display this in a query aswell and have it at a certain size say 400*300~

Anyone got any tips/guides that can explain / help me on this?

Kind regards
Is7doji
 
aye kinda guessed that the filename would be faster/better but how would i go about it since i was thinking of a simple upload for for her.

field one
image to upload from her pc to server which would prob be /uploads/images/filname.type so would need to grap the extension /name of this file
field two
field three
 
Thanks for the input, ive gone with the storing the filename in the db, ive got the displaying it correctly but having a few problems graping the filename/extension

the code ive tried

Code:
$sql="INSERT INTO concept_art (id_number, name, image)
VALUES
('','$_POST[name]','.$HTTP_POST_FILES['ufile']['name'].')";

but i seem to get the error with this

Code:
'.$HTTP_POST_FILES['ufile']['name'].'

anyone got any sugesstions?

Kind regards
Is7doji
 
Like to say thanks for your input, got it working the way i want =D
Just need a little help as im adding a bit more functionality to it, so wondering how i would add a lnk(url) to where the image is so when they click the image it will show the full image in the browser. Had a look at silverlight i think it was which i will add later but for now i was just want it in the browser.

this is the code i have for my image to display so guessing i would have to add the <a>url$row</a> in there i think, havent tried it yet tho

Code:
echo '<img src=' . $row["example"] . ' width="400" height="200">';

Kind regards
Is7Doji
 
Back
Top Bottom