Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP






SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Access The BLOB Data Type


How should I access the BLOB data type using PHP from a MYSQL database ?




View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
How Can I Convert Ascci Data To Blob (BINARY) String Type?
I want to convert ASCII characters (Stored as TEXT) to MySql Blob data type where the ASCII data will store as BINARY. The data will store like the format below:
 
0x41675a7959ea

View Replies !   View Related
Determining Mime Type Of MySQL Blob?
Is there any PHP function that will allow me to determine the MIME type
of a blob stored in MySQL?

Specifically, if I'm storing an image as a blob in MySQL, is there any
PHP function that can determine whether it's a gif, jpeg, png, etc?

View Replies !   View Related
Downloading Image (type Blob) From Mysql
I've already posted this message on the 'database' forum, but didn't get a response, so I'm trying again here.

Basically, I can upload an image to the mysql database without a problem (storing it as type blob). However, I'm having great difficulty coding it so that a user can download it to their hard-drive via a link. Code:

View Replies !   View Related
How To Generate Blob Data To Pdf
I want to know how can i convert a blob data into pdf file?

View Replies !   View Related
Blob Data - Timeout Issue
Hello,

I have success when uploading a binary file to a mysql "blob" type when a file is not larger than 2.5MB. When uploading a file >2.5MB, I get an error of MySql server has gone away or cannot allocate file and I get "Couldn't Add File to Database" .
I've read the manual on the error, but having checked all the settings i.e. max_allowed_packet=16M, php.ini settings of upload_max_filesize=16M, post_max_size=16M, max_execution_time=3600 and also httpd.conf timeout= 3600 and the error still persists. Is it mysql, php, apache or the script?

HTML:

<form enctype="multipart/form-data" name="frmUploadFile" action="grabfile.php" method="post">
<INPUT TYPE="hidden" NAME="MAX_FILE_SIZE" VALUE="16000000">

The script: grabfile.php

<?
$dbServer = "localhost";
$dbDatabase = "";
$dbUser = "";
$dbPass = "";

$fileHandle = fopen($fileUpload, "r");
$fileContent = fread($fileHandle, $fileUpload_size);
$fileContent = addslashes($fileContent);

$sConn = mysql_connect($dbServer, $dbUser, $dbPass)
or die("Couldn't connect to database server");

$dConn = mysql_select_db($dbDatabase, $sConn)
or die("Couldn't connect to database $dbDatabase");

$dbQuery = "INSERT INTO myBlobs VALUES ";
$dbQuery .= "(0, '$strDesc', '$fileContent', '$fileUpload_type')";

mysql_query($dbQuery) or die("Couldn't add file to database");

echo "<h4>Upload of $fileUpload_name is complete.</h4>";
echo "The details of the uploaded file are shown below:<br><br>";
echo "<b>File name:</b> $fileUpload_name <br>";
echo "<b>File type:</b> $fileUpload_type <br>";
echo "<b>File size:</b> $fileUpload_size <br>";

?>

Any suggestions?

View Replies !   View Related
BLOB Data As Src For Thumbnail Creation?
I have images stored on my MySql database as Binary "BLOB" filetypes. I want to make thumbnails of these files to display. I know how to create thumbnails using paths and image names of .jpg files. But I do not know how to use Binary"BLOB" image data to create them.

Do I have to encode the data in a certain format for the getimagesize(), ImageCreateFromjpeg() and imagejpeg() functions to work? Or does this have something to do with specifying a MIME type? I don't know how to get the functions to read the BLOBs.

View Replies !   View Related
How Do I Get Image Data Into A Blob Field
I am trying to get image data into a mysql field (like a simple jpg). Does anyone have a quick tips on how to submit an image (through an html form) process via php and insert into a mysql blob field?

View Replies !   View Related
Copy BLOB Data In Query?
Trying to copy BLOB data between tables, but...while both table.fields are LONGBLOB fields, ONLY the file size is copied i.e [BLOB - 252.6KB]Code:

UPDATE orders, contract_pdfs
SET orders.contract_pdf = contract_pdfs.content
WHERE orders.id = contract_pdfs.record_id

View Replies !   View Related
How To Save Blob Data To Hard Disk?
I have stored my document files in a blob field (mysql)I know how to allow users to download the file manually one by one But I want to loop through the whole table and export the blob data as files and store it in hard disk.

View Replies !   View Related
How To Access Server Log Type Information
I have a possible problem with a form which is being filled out on one of my sites. My logs indicate that it is being fetched repeatedly by some people who are visiting it. I sounds like the validation is throwing them back to the form but it is pretty explicit and I need to check what is actually happening.

I need to be able to access the same kind of information that is used in the apache logs (ip address etc.) and dump this with information from the program into a file.

Can anyone direct me to code that allows me to get the ip address, browser type etc.?

View Replies !   View Related
Inserting Image File Binary Blob Data To Longraw Field Problem
i have a table that has 3 columns:

tablename: files
column names = fileno, files, ex1
fileno: number
files: longraw -> storages blob
ex1: varchar2(1)

there are a lot rows in table.. blobs.. files field has blob data. so i can read them, there is no problem here.

but i can t insert data to this table. this command works fine with toad:

insert into files values(123,rawtohex(&#39123;'),'');

but i must insert image binary data to files field. when i used rawtohex function with php, query fails after 4000 character. Code:

View Replies !   View Related
Created A Small PHP Module Which Extracts JPEG Data From A MSSQL Blob Database
I created a small PHP module which extracts JPEG data from a MSSQL blob database field (using ADODB), resizes it and then sends it to the browser, so that it can be used as argument for IMG SRC. Here's a little bit of code:

if ($_GET["pnr"]) {
$pnr = stripslashes($_GET["pnr"]);
$pnr = str_replace(chr(34),"",$pnr);
$pnr = str_replace(chr(39),"",$pnr);
$w = 128;
$h = 96;
$conn = &ADONewConnection("mssql");
$conn->PConnect($g_host, $g_user, $g_pass, $g_db);
$rs = &$conn->Execute("spi_GetPersPict '$pnr'");
$newp = imagecreatetruecolor($w,$h);
.......

View Replies !   View Related
Data Type Change Without Loosing Data
I have a problem in mysql. I stored a date in  08/14/2006 format and choose a datatype longtext now i want to store date in 2006-08-14 form is it possible to do it without loosing data in db when i convert datatype longtext to date the data lost. Any solution?

View Replies !   View Related
Update Mysql Blob With Another Blob Using Php
I have a blob field in a mysql database table. I want to copy a blob
from one record to another. I am having trouble transferring the data
via a php variable. Maybe I need to addslashes or convert to Hex or
something. I've tried a few things but can't quite get it. Here is
simplified code.

mysql_select_db($dbname, $connection);

$query = "SELECT blobthing
FROM mytable
WHERE id = 1;";

$results = mysql_query ($query, $connection);
$row = (mysql_fetch_assoc($result));
$varblobthing = $row['blobthing']; //put the blob in a variable

$query = "UPDATE mytable
SET blobthing = ".$varblobthing.",
WHERE id = 2;";

mysql_query ($query, $connection);

View Replies !   View Related
Using MS Access To Hold The Data And PHP To Collect The Data From The Database
I am using MS Access to hold the data and PHP to collect the data from the database and display it on a website. I've got the results displaying in the normal way with data being displayed in a linear manner e.g. Code:

View Replies !   View Related
Text Data Type
Can somone give me an example of using the text data type with PHP stored into MySQL.

View Replies !   View Related
Changing Data Type
I want to change data type of some variable, if it would be C++. following would be the code:

int $var;
$var=int($str);

i have two questions, how to declare $var as int in PHP, secondly how to cast a variable  like () in PHP.

View Replies !   View Related
Mysql Data Type Int(10)
i understand that int is 4 bytes, but what does the (10) means?

View Replies !   View Related
Field/data Type
I was wondering what type of field is needed to store values of a radio button like below:

<td>Premises, facilities and/or equipment are managed better</td>
<td><input type="radio" name="RadioGroup50" value="Most valuable"></td>
<td><input type="radio" name="RadioGroup50" value="Valuable"></td>
<td><input type="radio" name="RadioGroup50" value="Quite valuable"></td>

and a checkbox like this


<td>Age Concern - own standards</td>
<td><input type="checkbox" name="checkbox3" value="Heard of this"></td>
<td><input type="checkbox" name="checkbox4" value="Relates to organisation"></td>

View Replies !   View Related
Data Type Dilemma
Having some trouble with data types. In my script, I need the table's data to be ordered by "page", but the values have mixed char/num data (for instance, "21-22"). Because of the hyphen, I have to set it to VARCHAR (or it will erase the hyphen completely), but since it's a number, it won't order properly. For example, let's say my page numbers are 1, 21-22, 31, 121. Code:

SELECT * FROM 'table' ORDER BY page;

Would return: 1, 121, 21-22, 31 (it's ordering by the first digit in the value only).

Is there a datatype that will allow me to include hypens, but still order properly as numeric data?

View Replies !   View Related
How Do I Get The Data Type And Length?
I am a student taking my first PHP class - semester is almost over and my final project is finished, but I'd like to learn to do something and add it to my project. I would like to query a table in my database regarding its structure and based on that dynamically create a form to edit contents.

So, from the result I'd like to pull the table column names and field lengths, maybe the types. I believe that an mysql DESCRIBE query will get me that information, but how do I go about assigning the return to variables so I can create my form. How do I get the column names instead of the data in a normal query, and how do I get the data type and length?

View Replies !   View Related
Boolean Data Type
In a forum elsewhere there was a question concerning the use of radio buttons and the stated that they were placing values into data fields that were TINY INT(1) which I believe is also a BOOLEAN data type and will accept only the values of 0 or 1, am I correct in my thinking since I pointed out that they were in fact using a BOOLEAN whether they knew it or not.

View Replies !   View Related
Type Of Data Returned By A Function
I've noticed that some code analyzers comment that the type of data
returned by my functions is "unknown" in the following syntax:

function fnFooBar($aryParameters) {
$bRetVal = True;
return $bRetVal;
}

I *think* I can specify that by doing something like this:

function fnFooBar($aryParameters) bool {
$bRetVal = true;
return $bRetVal;
}

Is this correct?
If so, is there a performance gain, or is it just clean coding?

View Replies !   View Related
Date Field - Which Data Type?
Im making a date field in mysql, but im not sure which data type to make it, like a number should be INT(xx), but what about a date?

View Replies !   View Related
SQL Server Data Type TEXT
I have a data type text in my SQL Database and I have a textarea where the user types in an article.

The problem is that when i submit the form, some of the article gets cut off when it stores it in the database. I know text has a length of 2^31-1. So why does it cut off?
Any ideas?

View Replies !   View Related
How Do I Determine The Data Type Of Any Variable?
How do I determine the data type of any variable? any function available?

I'm having trouble because i do a

print_r($var);
and it outputs

Array ( .... )
but when i do an

array_key_exists("something",$var)
it returns says second argument must be array or object

im confused. even

is_array($var)
returns true

View Replies !   View Related
Capacity Of Text Data Type
what is capacity of Text data type in mysql? is it able to contain 15 - 20 pages text?

View Replies !   View Related
Enum Data Type Versus
What are pros and cons using enum data type instead of using another data type and putting the values in another table.

View Replies !   View Related
Does Anyone Declare A Different Data Type On Every Input In A Form?
I'm trying to read up on the rfc's that govern form inputs. Much of
what I'm reading is stuff I didn't know before and some of it is
alarming. This one left with me questions:

Is this (below) addressed to me as a web designer, or is this
addressed to the makers of web browsers? Identifying the type of file
being uploaded seems way outside of my scope as a PHP coder. Am I
suppose to make clear the expected type of content when I design a
form? Off hand, I can only think of two things that every go into an
HTML form: strings and binary data. Should I actually label every
INPUT with the expected type (does anyone do this?), or can I assume
the makers of web browsers have already done that for me? My PHP form
code is fairly concise, so I could add in mime/text rather easily, but
is it necessary? Surely the browser knows that everything save binary
files is a string?

They wrote:

3.3 use of multipart/form-data

The definition of multipart/form-data is included in section 7. A
boundary is selected that does not occur in any of the data. (This
selection is sometimes done probabilisticly.) Each field of the form
is sent, in the order in which it occurs in the form, as a part of
the multipart stream. Each part identifies the INPUT name within
the
original HTML form. Each part should be labelled with an appropriate
content-type if the media type is known (e.g., inferred from the
file
extension or operating system typing information) or as
application/octet-stream.

They give the example below. Am I right to say that I don't need to
think about any of this, that the web browser does all this
automatically? The browser figures out that file2.gif is a gif image
that needs to be sent with a the header Content-type: image/gif, yes?

If the user also indicated an image file "file2.gif" for the answer
to 'What files are you sending?', the client might client might
send
back the following data:

Content-type: multipart/form-data, boundary=AaB03x

--AaB03x
content-disposition: form-data; name="field1"

Joe Blow
--AaB03x
content-disposition: form-data; name="pics"
Content-type: multipart/mixed, boundary=BbC04y

--BbC04y
Content-disposition: attachment; filename="file1.txt"

Content-Type: text/plain

... contents of file1.txt ...
--BbC04y
Content-disposition: attachment; filename="file2.gif"
Content-type: image/gif
Content-Transfer-Encoding: binary

...contents of file2.gif...
--BbC04y--
--AaB03x--

If I wanted to send multiple
files as part of a form input, how would I use the multipart/mixed
header, or the "content-transfer-encoding" header? Can anyone point me
to an example, so I might have a better chance of understanding this?

As with all multipart MIME types, each part has an optional
"Content-Type", which defaults to text/plain. If the contents of a
file are returned via filling out a form, then the file input is
identified as the appropriate media type, if known, or
"application/octet-stream". If multiple files are to be returned
as
the result of a single form entry, they should be represented as a
"multipart/mixed" part embedded within the "multipart/form-data".

Each part may be encoded and the "content-transfer-encoding" header
supplied if the value of that part does not conform to the default
encoding.

View Replies !   View Related
Change Format Style For Datetime Data Type
I don't know how to change the default format style for datetime data type.

When I retrieve data from a table the datetime fields are displayed as "day_number month_name Year" but I need it to be displayed as normal form: "month/day/year".

I have been trying to do it using setlocal, but I don't know how to use it.

View Replies !   View Related
Displaying Binary Data To Browser And Set Mime Type
I am looking for a link or help on how to set the
mime type in my php script as well as send binary data to the browser
window instead of having it ask me to save the file.

View Replies !   View Related
Is There A Work-around For The Lack Of A DATE-only MSSQL Data Type?
I had my code working perfectly for MySQL and then my boss decides to swing his weight around and force all code to be written for MSSQL (without even understanding MySQL)

In MySQL I used a DATE data-type, and it appears that there is no such animal in MSSQL. I am left with trying to figure out how to use the DATETIME data-type, when all I need is the DATE portion.

Is there a way to strip the time part of the DATETIME data-type from being returned? When I echo the variable which enters the date info, it returns as "Sep 23 2005 12:00AM", when I don't really want to see the time..

View Replies !   View Related
Column Data-Type For Storing Serialized Array In MySQL?
I'm really not sure - I used BLOB in the past- but the arrays are only a few kilobytes. But VARHCAR only allows 255 characters at most and the arrays might contain many more characters than that.

View Replies !   View Related
<input Type=file> How To Update Form Data In Mysql
i have been struggling with a problem with file uploads and mysql for a while on and off and have recently dug out my php bible to learn some more i figured out, after a lot of reading and hours of trial and error, how to use a html form to upload text and file paths into a mysql database.

i`m a relative newbie, so i`ve not had time yet to try everything out. my problem is when i use <input type=file> i save the path to an image etc that i have uploaded in a mysql db, but if i want to change any of the text data within my form i cannot keep the image path in the db, but i have to browse for the image again or it will be a broken link? Code:

View Replies !   View Related
PHP - Data From Access Db
I'm using the code below as a base for a connect to an access
database.
This works well, but I have an issue...

<?php
$db = "./access.mdb" ;
$pass = "1234" ;

$conn = new COM("ADODB.Connection") ;
$sql = "DRIVER={Microsoft Access Driver (*.mdb)} ;
DBQ=". realpath($db) ." ;
uid=admin ;
pwd=$pass ;" ;
$conn->open($sql);
$rs = $conn->execute("SELECT * FROM TableName");
while (!$rs->EOF) {
echo $rs->Fields['FieldID']->Value ;
echo $rs->Fields['FieldName']->Value ;
$rs->MoveNext() ;
}
$rs->Close() ;
$conn->Close() ;
?>

using this:
while (!$rs->EOF) {
echo $rs->Fields['FieldID']->Value ;
echo $rs->Fields['FieldName']->Value ;
$rs->MoveNext() ;
}

View Replies !   View Related
Using PHP To Access WinAmp Data
Does anyone know of a way to use PHP to display on a web page the playlist (m3u) information for a file currently being played by winamp?

Note this is not about *controlling* winamp, but accessing data in real time to display current file / playlist name being played.

View Replies !   View Related
Best MYSQL Data Access?
I was just wondering if anyone had, or knew of a good MYSQL dataaccess layer for PHP.

I am using the smarty templating system, which mainly handles arrays and such so if anyone has any ideas.

View Replies !   View Related
Access Data In Webpage
I have a data base in access having 6 columns and around 120 entries. I want some script or some coding through which I can extract the data into a webpage.

for example say if I create a link with TTT and on clicking this TTT the next page should display the results from database in a webpage in table format ..

View Replies !   View Related
Data Access Class
I'm working on a class to access a MySQL database. One function I'd like to have is one that lists the records in a table. But, I'd like to be able to read from a loop. Ex:

while ($x = $class->function())
{
echo $x['fieldname'];
}

View Replies !   View Related
Enter Data To Ms-access
i have a problem to enter information(record) to ms-access in php i have a error:

"Warning: odbc_do() [function.odbc-do]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement., SQL state 37000 in SQLExecDirect in C:Documents and SettingsAdministratorMy Documentsdb7.php on line.

View Replies !   View Related
Connecting To An Access Data Base
i want to connect to a Access data base but dont know how to do it. also how would u add more rows if needed and how would u write to the cells in the tables.

View Replies !   View Related
How Can I Restrict Access To Data File?
I have a php script that processes a form and then posts the user
input to a data file on the server in a comma delimited format. For
simplicity call the file "data.csv." The script is working well and
the data is posted correctly to the data file.

The big problem is that anyone can point their web browser to...

View Replies !   View Related
Importing Form Data To Ms Access
Does anyone know if one can import a web form data into ms access db? Does the ms access db have to be on the same server as the web form?

View Replies !   View Related
Access Those Session Data Through Cookie
Now I just want to know if this is correct, if i store information in my session and i have a javascript cookie class, i can access those session data through cookie, correct because all a session really ism is a cookie, right?

View Replies !   View Related
PHP And CSS - Storing The Data In An Access Database
I am creating a web based calendar for tracking appointments. I am storing the data in an access database(may go to MySQL later)I have three different catagories that i would like to display with different backrounds and font colors.

View Replies !   View Related
Transfer Data From Access To MySQL
How easy is it to transfer datafrom a MS Access database to a MySQL one? How can this be done?

View Replies !   View Related
Access Anonymous Ftp And Parse Data
Hello everyone. I'm definately a newbie at this so go easy. I am trying to get together a script to access some aviation weather from noaa. They have an anonymous ftp server that you can access txt files with weather data in them. I'd like to make a script to access the airports from a specific state (which are defined in the script which airports for which state) and echo that to an html file. The script would have to 'find' the airports in the txt file then parse out the info. Here is an example of what's in the data files.

Code:
2006/01/18 17:00
GCFV 181700Z 190024 35006KT 9999 SCT030
BECMG 0911 10007KT
TEMPO 0818 VRB03KT

2006/01/18 17:00
GCLP 181700Z 190024 01010KT 9999 FEW030
BECMG 0911 06008KT
TEMPO 0818 VRB03KT

2006/01/18 17:00
GCRR 181700Z 190024 35006KT 9999 FEW030
BECMG 0911 09007KT
TEMPO 0818 VRB03KT

2006/01/18 17:00
GCTS 181700Z 190024 05008KT 9999 SCT030
BECMG 0911 15008KT
TEMPO 0024 VRB03KT

Can someone kind of point me in the right direction on how to do this?

View Replies !   View Related
XML Parsing - Easy Way I Can Access The Data?
I hate XML it drives me nuts I have some results from the shopping.com API which is lovley but I can't do anything with them. Is there an easy way I can access the data? Code:

View Replies !   View Related
Import Data From Access Database To MYSQL
I have some data in access database. I wish to import it (keeping the same structure) in MySQL.

Also I want to know what will be procedure for importing data from databases like Oracle, Sybase, Informix etc.

View Replies !   View Related
Hiding MySQL Access Data In Php File ?
If I connect to a mySQL database with php I have to write the access data into the php file,eg.:

$hostname = "my_host";
$username = "my_name";
$password = "my_pwd";
$dbName = "my_db";
$userstable = "my_table";
MYSQL_CONNECT($hostname,$username,$password) OR DIE("Unable to connect to database");

Is this secure ? In other words: can it be read by a bad boy ?

View Replies !   View Related
Access A Website, Fetch The Data, And Then Logout
I need to access a website, Fetch the data, and then logout. Please
tell me where I am wrong. I dont think its logging out properly.

<?

include "Snoopy.class.php";
$snoopy = new Snoopy;

//Logging in
$submit_url =
'http://www.sortingcodes.co.uk/FormsLogin.asp?action=login&URL=Default%2Easp'
$submit_vars["Username"] = "Username"; //my username
$submit_vars["Password"] = "Password"; //my password
$submit_vars["Submit"] = "Go";
$snoopy->submit($submit_url,$submit_vars);

//Requesting for info
$snoopy->setcookies();
$submit_url =
'http://www.sortingcodes.co.uk/Results.asp?type=Sortcode&Page=1&Sortcode=402343'
$snoopy->fetch($submit_url);
echo $snoopy->results;

//loggin out
$snoopy->setcookies();
$snoopy->fetch("http://www.sortingcodes.co.uk/logout.asp");

?>

View Replies !   View Related
Using PHP To Migrate Data From Shared Access Db To MySQL
I've read some online resources that utilize various MySQL
command-line actions to migrate data from Access to MySQL.

The situation is this: a group of co-workers of mine will be using an
Access db in a shared source (for now, a directory.. ???) to be able
to generate reports on the fly. What they want to do is to be able to
migrate that data to a MySQL db instance that currently exists on a
different server.

What would be the best way to do this within a PHP wrapper (if even
PHP at all, which I prefer); if so, what are the ways I can ensure
security as this is US Federal Government data and thus must be locked
down tight?

View Replies !   View Related

Copyright © 2005-08 www.BigResource.com, All rights reserved