mikerosenthal Posted October 23, 2006 Share Posted October 23, 2006 OK. i really have been trying to do this for weeks, but keep in mind i am more or less a newbie...I have setup an event calendar system wherein the administrator creates a new event from a calendar (well, from the php script webcalendar - http://www.k5n.us/webcalendar.php). once this event is created, she can then go to an Event Editor page i built, where she can fill out a lot more information about the event (price, description, staffing, etc). I would also like for her to be able to insert an image into this existing record while she is filling out all this other info, then hit save, and have all this info and the image saved with the record. I have read many tutorials on how to upload and display images using php and mysql. I have gotten these to work just fine. however, none of them seem to take into account the scenerio of wanting to upload an image into an existing record (ie, they all create a new unique id), whereas i need the example to take into account the unique id of whatever record she is editing and replace into (or insert into? im confused) that one. i realize this is a slightly confusing post, so please feel free to ask me to clarify a point or post an example. but does anyone understand my confusion? or can anyone point me to a tutorial on uploading images into existing mysql records from php? thanks for your help!-mike Quote Link to comment Share on other sites More sharing options...
Barand Posted October 23, 2006 Share Posted October 23, 2006 At the moment you probably have something likeUPDATE events SET description = '$description', price = '$price'WHERE eventid = '$id';Having uploaded the image and moved to "$path/$filename" on the server, your update becomesUPDATE events SET description = '$description', price = '$price', image = '$path/$filename'WHERE eventid = '$id'; Quote Link to comment Share on other sites More sharing options...
mikerosenthal Posted October 28, 2006 Author Share Posted October 28, 2006 actually, im trying to store the images in the mysql table. does that make a difference? Quote Link to comment Share on other sites More sharing options...
Barand Posted October 28, 2006 Share Posted October 28, 2006 Not recomended, better to store file on server and the link to it in the db Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.