Re: BLOB retrieval
| From: | Dave Smith | Date: | Tue, 24 Sep 2002 12:52:57 +0000 |
| Subject: | Re: BLOB retrieval | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-21961@lists.php.net to get a copy of this message | ||
Go to www.php.net and type in the name of your database (mysql, postgres, oracle, mssql) in the search box. That will give you a list of all the functions available. Getting a blob is generally the same as getting any other data type. Here's the paradigm:
1. connect to the database
2. execute SQL statement
3. parse/display results
WIth MySQL, this is done with the following functions:
// 1. connect to the database
mysql_connect( <host>, <user>, <pass> );
mysql_select_db( <db_name> );
// 2. execute SQL statement
$result = mysql_query( <sql> );
// 3. parse/display results
$array = mysql_fetch_array( <results of above query> );
Here are a couple pretty decent tutorials on using PHP and MySQL that will probably get you started:
http://uug.clubs.byu.edu/articles.php?show_article=11
and
http://uug.clubs.byu.edu/articles.php?show_article=53
But, of course, PHP.net is the ultimate source of excellent documentation on php. You should rarely need to go anywhere else (including google) to get most php info.
Good luck. Let us know how it goes!
--Dave
chekmate (remove) wrote:
Hi everyone, I am new to php. I have searched the net trying to find a basic code snippet that will demonstrate how to download BLOB's from a database. I am not looking for a solution exactly, but rather a good starting point. I want to learn this on my own. Maybe with a little help. :) Is there a resource you could point me to? Or could someone post a small sample of code that will get me started? Thanks in advance, Tim Eberly