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

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')";
?>

.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.