views:

76

answers:

2

This is quite a noobish question, I have searched for a few hours now and I know this has to be simple. I am using XAMPP and I am trying to learn some more about using PHP and mySQL together. When I create the DB and the table for information to store, I tried insert info to the table and it stores it as a .dat file rather than text. I know this has to be with how I am setting up the table or the DB but I have gone through things and I think I am just skipping over something.

* Apache/2.2.12 (Win32) DAV/2 mod_ssl/2.2.12 OpenSSL/0.9.8k mod_autoindex_color PHP/5.3.0 mod_perl/2.0.4 Perl/v5.10.0
* MySQL client version: 5.1.37
* PHP extension: mysqli

that is the phpmyadmin info.

+1  A: 

When you're editing table field's properties, there is one which affect presentation of the field data in phpMyAdmin: "Browser transformation". When it is set to "application/octetstream: download" for some field, phpMyAdmin instead of displaying text "as is", allows to download its content as a (binary) file and displays that as a "binary_file.dat" url to that file.

You can change this behavior by changing "Browser transformation" for your text field to something else (an empty value would be good).

Alexander Konstantinov
Thanks that fixed it. Of the options for that which is the best for any text? I just left it with text/plain: formatted
chenger
@chenger, you can read tooltips for each option in the list, there are explanations what each transformation does. "text/plain: formatted" is good if your field contains valid HTML.
Alexander Konstantinov
A: 

Are you saying that when you do something like

SELECT textfield FROM datatable;

on your database, you get a result that looks like:

+-----------------+
|    textfield    |
+-----------------+
| binary_file.dat |
+-----------------+

instead of getting the contents of the file you'd tried to insert?

Marc B