View Single Post
Old 10-11-2022, 03:57 PM  
zijlstravideo
Confirmed User
 
zijlstravideo's Avatar
 
Industry Role:
Join Date: Sep 2013
Location: The Netherlands
Posts: 805
Quote:
Originally Posted by Publisher Bucks View Post
Also, as a secondary question on the same subject, once the file is uploaded to the directory on the server, how would I go about submitting that url to a row in my SQL database and attaching it as an image to a specific recipe?
Another really simple approach would be to rename your uploaded file to the same name of the title of the recipe. Then you can skip adding the image to a database entirely.

$recipe_title = "Salty Seamen Sauce";
$recipe_image = trim(str_replace(" ", "-", strtolower($recipe_title))) . "jpg";
// which would become salty-seamen-sauce.jpg
__________________
Contact: email
zijlstravideo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote