I have been troubleshooting all day and have run into a brick wall. I have done this time and time again, but for whatever reason, my code is NOT working....or my head is not working. Lol. I am trying to insert an image into a MySQL database, but it IS NOT GOING INTO THE FREAKIN’ DATABASE….however it is going in the directory(the "images/bgimages/" folder). Every statement seems to be fine…the field is called “bg_image”. I must be missing something, so I was hoping a fresh pair of eyes may help. Below is the code for the image insertion field, where I declare the variable, and where I insert it in the database. HELP!
<input name="bg_image" type="file" class="form" id="bg_image" size="60">
$bg_image = $_POST['bg_image'];
mysql_query("INSERT INTO hex SET custom_name = '$custom_name', body_bg = '$body_bg', bg_image = '$bg_image', bgrepeat = '$bgrepeat', bgshow = '$bgshow', body_text = '$body_text'…….
Thanks...
Rooomka
Image is going into directory but not database
Moderator: General Moderators
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: Image is going into directory but not database
Code: Select all
$bg_image = $_POST['bg_image']['name'];Re: Image is going into directory but not database
Worked like a champ! Thank you!