| | |
How insert image into mysql database and retrieve
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
Are you sure you really want to do that? I think that for most applications you will be better off storing the image in a folder on your webserver and adding the location/details of the image to the database.
•
•
Join Date: Jan 2006
Posts: 29
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by DanceInstructor
Are you sure you really want to do that? I think that for most applications you will be better off storing the image in a folder on your webserver and adding the location/details of the image to the database.
Thank you.
Roland
I haven't tried this myself, but there is a brief tutorial here:
http://hockinson.com/index.php?s=37
Good luck.
http://hockinson.com/index.php?s=37
Good luck.
•
•
Join Date: Mar 2006
Posts: 31
Reputation:
Solved Threads: 3
I will agree that it is rare that you would want to do that outside of a data hosting site like that. Otherwise you can just store the url and output it however you want by calling it with php and tellting using the following code
echo '<img src ="'.$imgurl.'">';
That will output it as the image itself. Naturally you can add the formating to it. But I find that method INCREADIBY effective.
echo '<img src ="'.$imgurl.'">';
That will output it as the image itself. Naturally you can add the formating to it. But I find that method INCREADIBY effective.
[IMG]http://img.photobucket.com/albums/v626/darklorddeamon/dgstudios.jpg[/IMG]
When all that is becomes one. That is the anomoly. That is... Death's Gate Studios (c) 2005
When all that is becomes one. That is the anomoly. That is... Death's Gate Studios (c) 2005
•
•
Join Date: Mar 2006
Posts: 31
Reputation:
Solved Threads: 3
I store things in it using full text
I store it using a variable like so
$value = '<b><center><fontcolor= "blue">This is the formated text</b></center></font>';
$query = "instert into table ('$value')";
mysql_query($query);
I use formated text alot for my forum.
Also it is possible to simply output it the text using concatenated strings with php. Its up to what you're using the text for.
I store it using a variable like so
$value = '<b><center><fontcolor= "blue">This is the formated text</b></center></font>';
$query = "instert into table ('$value')";
mysql_query($query);
I use formated text alot for my forum.
Also it is possible to simply output it the text using concatenated strings with php. Its up to what you're using the text for.
[IMG]http://img.photobucket.com/albums/v626/darklorddeamon/dgstudios.jpg[/IMG]
When all that is becomes one. That is the anomoly. That is... Death's Gate Studios (c) 2005
When all that is becomes one. That is the anomoly. That is... Death's Gate Studios (c) 2005
•
•
•
•
I store things in it using full text
I store it using a variable like so
$value = '<b><center><fontcolor= "blue">This is the formated text</b></center></font>';
$query = "instert into table ('$value')";
mysql_query($query);
I use formated text alot for my forum.
Also it is possible to simply output it the text using concatenated strings with php. Its up to what you're using the text for.
You can make the following:
1. Store value $formatted_text = This is the text to be returned in red.
2. Retrieve it in your php page like this: [php]echo '<p style="color: red">'.$formatted_text.'</p>'; [/php]and you will get it right

if you want you can use a class for this statement and add a lot of other formatting stored in an external file.
In case however you have some text and you want to store only one word with formatting, you better do the following:
[php] $formatted_text = 'This is the text with <span style="color: red;">red words</span> in the middle.';[/php]
When you retrieve it in your php like this:
[php]echo '<p>'.$formatted_text.'</p>';[/php]
you will have a paragraph with "red words" being the only red words inside the text.
If you are not familiar with CSS go to http://www.w3schools.com/ and learn it for free from the W3C. Good luck!
Last edited by Rhyan; Oct 19th, 2006 at 10:10 am. Reason: A bit of additional info added
•
•
Join Date: Oct 2006
Posts: 10
Reputation:
Solved Threads: 1
All u do is, use ASP. The database that I've chosen is Microsoft Access database. I could have explained it on Microsoft SQL server but I chose Access because it is inexpensive and widely available. Transition form Access to SQL Server is painless.
![]() |
Similar Threads
- how to retrive image file from mysql databse using php (PHP)
- retrieving a single cell of data from a MySQL database (PHP)
- Why does it insert NULL values into MySQL DB??? (ASP.NET)
- retrieving image from mysql database using php (PHP)
- how deposit a picture to MYSQL database (PHP)
- Update entire Mysql DataBase with PhP (PHP)
- insert image into mysql (Visual Basic 4 / 5 / 6)
- case and image help please (PHP)
Other Threads in the PHP Forum
- Previous Thread: adldap using php in linux machine
- Next Thread: GET , POST and REQUET not working
| Thread Tools | Search this Thread |
.htaccess alexa apache api array beginner beneath binary broadband broken cakephp checkbox class cms code convert cron curl database date display dynamic echo email emptydisplayvalue encode error fcc file files folder form forms function functions google howtowriteathesis href htaccess html image images include insert ip javascript joomla key keywords limit link login mail mail() memberships menu mlm multiple multipletables mysql mysql_real_escape_string network oop open passwords paypal pdf php provider query radio random redirect remote rss script search securephp server sessions smtp source space sql strip_tags syntax system table template tutorial update upload url user validator variable video voteup web youtube





