How to upload image in mysql?
Check out this article.
The way I'd do it, allow someone to upload to a directory "Images/" and then put the link into a PHP script.. For example:
$query = "INSERT INTO images (user, link) VALUES ('Phil++', 'http://www.yoursite.com/images/image-name.png')";
And then to display the image would be:
$query = "SELECT user, link FROM images WHERE user='Phil++'";
$result = mysql_query($query);
while($row = mysql_fetch_array($result))
echo "<img src="' .$row['link']. '">';
That's how I'd do it.
The way I'd do it, allow someone to upload to a directory "Images/" and then put the link into a PHP script..
That is the standard (and recommended) method, but the way he asked the question made it seem like he wanted the images "in" the database.
But I wouldn't do that without a good reason. Doing it like you showed is by far easier, and usually less demanding on the server.
How to take part of url and store it into a variable?
/home/pages/id --> I want to take id out and store it into $id.
How to do ...
I have two files with slightly different codes from two different programmer. Me and the other guy. And I would like to move part of the working feature from ...
My script merges 18 files and returns all numbers that occur >=13 times within the merger. I timed my script and array_count_values is so slow it accounts for 80% of ...