Jump to content

how to save image in database using div tag


Recommended Posts

I'm not sure what you mean, use a div tag to save an image on the server? Confusing.

 

Anyway, usually you save the image on the server and in the database you save the filename (and the path if you wish). No idea what you're really talking about, but read up on how to let users upload an image to the server. A quick google search gave me http://www.tizag.com/phpT/fileupload.php

 

- W

Link to comment
Share on other sites

I'm still unsure what you mean by the div tag...are you talking about an HTML <div> tag? Or are you just referring to the PHP variable called "div"?

 

The code provided should work as long as the POST variable actually comes from somewhere like an HTML form. And that the query is being executed:

http://php.net/manual/en/function.mysql-query.php

 

 

Note that you don't need the curly brackets in this case.

 

 

<?php
$sql = "INSERT INTO divs (contents) VALUES ('$div')";
?>

.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.