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


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





Does Mysql Store Max Size For Data Type Each Time, Or Only What Is Needed For Specific Data?


If I use MEDIUMTEXT, which (if I understand correctly) has a max size of 65k, does mysql use the entire size each time data is written to that column? I have a text field on my site that users fill in, but more often that not, they don't. However, when they do, it can be 1000 bytes or more. Am I wasting space using MEDIUMTEXT or does mysql only set aside 1000 bytes for that column if the data is only 1000 bytes?




View Complete Forum Thread with Replies

Related Forum Messages:
Size Of Data Type 'Time'
I want to store time of the order of 3000 hours. But MySql is only supporting arount 831 hours or 30days.

View Replies !
How To Store Am/pm In A Datetime Data Type
I have the following:

$now = date("Y-m-d h:i:s a");

INSERT INTO table_name (start_time) values ('$now');

Column Name -- start_time
Data Type -- datetime

I do I get the "am/pm" to be stored with the date and time so it looks something like this "2009-02-20 04:20:23 pm"?

View Replies !
Size Of TEXT Data Type.
How big is the TEXT datatype by default? 0 bytes? I.e. if you declare a column to be of type TEXT but do not populate that column in a given row, will it then occupy 0 bytes of memory in that row? (if it defaults to NULL).

For that matter, will any column occupy 0 bytes of memory in any given row in which that column is not populated and where that column default to NULL?

(I am thinking in terms of C/C++ where a pointer does not point to anything unless memory is explicitly allocated and referenced to it).

View Replies !
Real-time Data Store And Analyize
I need to accept real-time quotes from quote provider and do real time analysis, would MySQL fill any gaps in whatever is needed to accomplish this?

So, the steps would be, Connect to the data provider using either web browser or their proprietary package. Connect using MySql to store the quotes. Run my algorithm live on the data stream. Store the results in the data base for further use.

View Replies !
Time Data Type
I have a column of data that represents a racing participants race finish time where time is measured with fifths of a second. I currently have the column stored as a varchar(4) data type because i could not figure out how to store it as a time and keep all my data. Here's an example of some of my 4 character stored data, followed by the explanation of what it really means.

2014 which means 2 minutes 1 second and four fifths of a second
1590 which means 1 minute 59 seconds and no fifths of a second
1561 which means 1 minute 56 seconds and 1 fifth of a second
2003 which means 2 minutes no seconds and 3 fifths of a second

Is there any way i could get this into a time data type that won't lose the fifth of a seconds? I want to be able to output it in a human readable format like
2:01.4
1:59.0
1:56.1
2:00.3

View Replies !
Data Type For Storing Time
I need to store times in my database. The times will be in the format of 10:15.03 minutes:seconds.milliseconds.

Which data type should I select for the field in the table? I will want to be able to sort them into order ie quickest first and also calculate the differences between each time.

View Replies !
Aes_Encrypt Error Data Too Long Even For Text Data Type
I am trying to insert data into a table with the column data type as text while using aes_encrypt, I get a warning ( if mode is traditional ) "data too long"
I even tried varchar(500) and still get the same error. BEcause of this aes_decrypt does not work. I guess the data is getting truncated

I am using version 5.0.27 in Linux 2.4 Kernel

It works absolutely fine in a Windows machine

View Replies !
Size Of Indexes Versus Data File Size
I am adding indexes to a table with about 200,000 records. Every field indexed adds about 2MB to the index file (*.MYI).

The index file is around 8MB and the data file is around 10MB.

Is there some optimum ratio I need to know about?

(I have examined the queries and am indexing field used in WHERE, ORDER BY and GROUP BY clauses.)

View Replies !
How To Store Data In BLOB Field Using MySql
I want to store file contents in BLOB field in Mysql database.

View Replies !
Help Needed With Load Data Infile Syntax
I'm relatively new to MySQL, and I've never used the Load Data Infile command. I'm having trouble getting it to work correctly. I have a comma separated file generated as output by another program that I can't seem to parse correctly. It contains data similar to the following:

VAL1, LASTNAME, FIRSTNAME, ADDRESS1, ADDRESS2, ETC1, ETC2, ETC3
VAL2, "LASTNAME, JR.", FIRSTNAME, ADDRESS1, ADDRESS2, ETC1, ETC2, ETC3

The "LASTNAME, JR." hoses up the import. It imports "LASTNAME into one field and JR." into another.

View Replies !
Is It Good To Store Html-formatted Data In Mysql Tables?
I always thought it is best to keep as much html as you can out of your stored data, in order to have flexible data. I am working now on a user friendly news-editor where the user can add news and format the text as wished (put links, bold/underline/italic etc..).

I am however a bit struggling with how I should proceed with this data. Do I just store it in the appropriate Mysql table and let it come out on the appropriate front-end news page? And not bother about the html in it? What if a user messes with the html? Should I strip all tags before storing it in the database and add them again while retrieving it on the news-page? If so, I know how to convert a few things, but not everything (like links, bold/underline..). Or are there other solutions?

Thanks!

View Replies !
Does MySQL Support A Boolean Data Type?
I ran a search through the mySQL manual and google and could not find a
satisfactory answer. Does mySQL support the declaration of a boolean
data type? Currently I am using VARCHAR(6)s with either 'TRUE' or
'FALSE' and would like to cut down on the storage.

View Replies !
Convert Nvarchar(max) To Mysql Data Type
-I've migrated my mssql database to mysql using SQLWays.

In my stored procedures I use several variables which are supposed to hold a great amount of data so I declared them in mssql as nvarchar(max), however in mysql they are migrated as NATIONAL VARCHAR(4000), which obviously limits them to hold up to 4000 characters, so my code doesn't work as I need it to.

What I need to know is the right data type to use so that I can achieve the great amount of data storage.

View Replies !
.xls / Csv Files Type Data Need To Insert In MYSQL Database
I have some importnat files in MS Excell / CSV format. I know php. I want to insert these files into MYSQL database to generate reports.

What are the techniques to insert the MS Excell / CSV files into MySQL?

View Replies !
MYSQL VARCHAR(5000) Vs.TEXT Data Type
I notices that the MYSQL folks define a varchar as being able to only store up to 255 characters. Obviously there must have been a change because I was able to create a Varchar(5000) data type and store information in it.

Can someone verify that the varchar data type was altered and what are the performance impact of using a Varchar(5000) vs. a TEXT dataype. my assumption is that using this Varchar(5000) datatype would be more efficient but you never know...

View Replies !
Specific Data
Ive been struggling with this for some time, wonder if someone can help, I have a database table column that has some information within it that I do not want, however there are over 100,000 records and it'll take some time to update them all - I'm trying to find the sql command to update the info currently I have:



PHP Code:

REPLACE * from table WHERE `column` LIKE '%data_not_needed%' 

I want to replace it with nothing so it simply takes the not require word / data out from that column - what else can I add into that sql command to show this?

View Replies !
Inserting Time Data Into MYSQL
I'm trying to insert an assortment of data into a mysql database. Although I'm having problems when inserting fields with time information.

Firstly, it's outputting it as HH:MM:SS and I need it to output as HH:MM. It's also defaulting as "00:00:00" even if I leave it blank.

I've set it up as TIME and set the default as blank and NULL ...

View Replies !
Select Only Specific Data In The Fields How?
I have a table called cclp_players
now that table has 3 fields for instance and has data see below,
-------------------------------
| player_id |team_id|division_id |
-------------------------------
| 001 | hp | golem |
| 002 | ibm | cestino |
| 003 | sun | mac os |
| 004 | del | bim os |
| 005 | acer | ms os |

Now i want to SELECT the table either by team_id or by division_id.
And let say i wanted to SELECT team_id by sun.

What is the right expression or combination of SELECT command for this?

View Replies !
Pulling All Data From Specific Month
I want to pull out all the data entries I've made for a specific month by using a $_GET method (archived.php?month=october). My field time rows look like "1161065143".

How can I do a mysql_query for this?

Here's what I have so far:

mysql_query("SELECT * FROM entrynote WHERE time = '$date' SORTED BY time DESC

View Replies !
Sql Query To Exclude Specific Data From Resultset
I have got two tables,one customer with fields cust_id,email and another with field cust_id,domname,expirydate. i have this query to combine these two tables to give me email and the expirydate as

$sql = "SELECT l.email,s.expirydate from customer l, domain s where l.cust_id = s.cust_id ";

I need to exclude those expirydates whose domname contains .np in the text.

View Replies !
Best Column Type To Store A C Structure In MySQL ?
I want to know the best column type for storing the data of a C structure variable. I am using C API for creating table and inserting the rows. If at all there is a one such type, if query the database inside the MySQL then how that column displays.

View Replies !
Store Data
Is there a way or code to store data, for example, photo files into MySQL after the users upload

View Replies !
Best Way To Store This Data
I'm doing a bit of a site where users can upload replays of games. The table (called 'replays') will have fields like id, name, date_uploaded .... which take up about 10 feilds.

But there also has to be a way to store data on each player. There can be up to 8 players in a game and the database must somehow record:

a) the name for each player
b) a rating for each player
c) and a second rating for each player.

Any tips on how to do this? I cant imagine having a database with 40+ feilds called player1rating1, player1rating2, player2rating1

View Replies !
Size Of Data
I need about a 1500 to 2000 character field and the only data type that seems feasable is TEXT but it can hold way more then 2000 characters. If I error check to make sure the entry is less then 2000 characters will it reduce the size of the database or does MySQL allocate the entire 65 thousand some characters so that it makes no diffrence.

View Replies !
Store Data For Menus
I wish to use MySQL to populate the names for several HTML menus using PHP. Some of the names are used in all three menus, however, others are only used in one or two of the menus. To eliminate duplicating the names, I only want one table to store all the names. I have two ways of doing this, and would like an opinion of which one is best.

One would be to store the names along with three columns to indicate which menu uses a given name, and then a querry could only return the applicable names.

ID Menu_Name Menu1? Menu2? Menu3?
1 Menuname1 Y Y Y
2 Menuname2 N Y N
3 Menuname3 Y N N
4 Menuname4 N N Y

The other way would be to only include the names in the first table, but then create a separate table for each of the menus, and use a subquerry to return only the appropriate names.

ID Menu_Name
1 Menuname1
1 Menuname2
1 Menuname3
1 Menuname4

Menu1Table
ID Name
1 1
2 3

Menu2Table
ID Name
1 1
2 2

Menu3Table
ID Name
1 1
2 4

Any suggestions on the best approach?

View Replies !
Best Way To Store Team Data?
I'm working on a sports project, and I'm trying to figure out the best way to store the names of players on a team in a database. For example, I might have an entry for "Los Angeles Lakers" which needs to have information containing the players "Kobe Bryant", "Lamar Odom", "Derek Fisher", etc.

Currently I just have 3 columns: Unique Team ID (integer), Team Name (varchar), and Players (varchar).

I'll enter the Lakers as: "001", "Los Angeles Lakers", "Kobe Bryant, Lamar Odom, Derek Fisher"

and then if I need to get out individual players, I just "explode" the array in PHP along the commas for the Players field.

View Replies !
Compacting / Data Size
I am (still) running some tests (dispite my problems), and I'd like to
know the size of data I have in order to calculate growth.

As a test I added some data, 1.69 Gb to be exact to a database, working
with it, then I deleted app 66% of it. When deleting it grew to 1.97
Gb.

I'd like to schrik that, as it will never again hold that amount of
data.
But more important - I'd like to know how much of that is actual data.

The point is, that Id like to delete even more data, and see the size
(of data) again.

View Replies !
Store The Data In The Database Or In Memory?
I am developing the server-based application and now trying to make up my mind on whether to store the data in the MySQL database or in memory.

Storing in the DB makes my life much easier, and I would prefer this approach, but this must be significantly slower than keeping all the data in memory. Access to memory is about 1000 times faster than access to disk. How slower is access to a record in MySQL compared to memory?

View Replies !
Store Data That Can Be Calculated In A Table?
As part of a current project I'm coding a simple forum as part of a website. The requirements are the usual, list of topics in various forums (categories) with associated posts.

I'm at the database design stage and up til now I've been storing all fields (e.g. number of posts on a topic) in a table in previous forum-style projects I've done. but I realise that using sub-selects I can calculate the number of replies like so:

SQL Code:
(SELECT COUNT(*) FROM posts WHERE topic_id = x) AS replies

in similar ways I can get the user who started the topic, the last user who posted on the topic and other info without having to actually store these.

is this a sensible approach? to store as little data as possible in the table (even if I'd only be storing a bunch of extra foreign keys) and make the database calculate/return the other data needed with a query?

I don't expect it will be a large forum so the performance hit should be unnoticeable - shouldn't it? I only ask because I've never done a forum this way before.

View Replies !
Store Web Site Club Registration Data (was "MySQL Question")
I am working on a website for a club. One thing that they want included in the site is a way for people to register online for the club and their services and for this information to be put into a database for the owners to view. Is this something that I can do with MySQL?

View Replies !
Bigger Table Size With Less Data?
I'm trying to change a table definition by dropping 2 columns from it because of normalization of data, also 1 index has to go away. The original .MYD file is 1.2Gb and the MYI 1.0Gb, the are about 20million records on it.

First, I tryed the ALTER TABLE route, but it were more than 2 hours later and still was going on... I checked the directory where the files are stored and the mysqloral MYD file was reaching 1.6Gb, so I stopped it.

Next I created a new table with the right schema, and issued a INSERT...SELECT from the original table, now the new MYD file is 1.7Gb and keeps growing.

Would the source table be corrupt? or is it normal behavior? .....

View Replies !
How To Import Data Through PhpMyAdmin With Size > 2MB
i have some trouble with importing data..

i use phpMyAdmin as my MySQL GUI..

is it any another way to importing data >2MB by phpMyAdmin?..

in my case.. to handle it.. i divide it to some file with size <2MB..
but i often facing trouble with this way..

View Replies !
What Type Do U Use To Store Currency Type?
What type do you use for storing price number? Decimal?
If you use decimal, how many decimal point do u use?
I use Mysql migration toolkit to convert my access db to mysql, and my Price column has been changed to decimal(19, 4).
Anyone use decimal(19, 2)?

View Replies !
Is There Ever A Situation When It Is Good To Store Duplicate Data?
Here is the situation.

Our site has many users (user_id). And many clubs (club_id).

Users can be associated with a club in a variety of ways...

Example

A "supporter" links a user_id to a club_id.

A "player" links a user_id (to a player_id to a team_id) to a club_id.

Notice how the first one goes straight from user_id to club_id, and the second goes via the players and teams tables.

At the moment, the data is stored poorly in separate tables.

Code:

link_supporters
user_id | club_id

Code:

link_players
user_id | player_id

I wanted to store all this data into one table and came up with the following solution.......

Code:

members
user_id | type | data_id

the type can be anything I choose: "su" supporter, "pl" player etc etc and the data_id can be any id I choose.

Example data for a supporter:

user_id: 12, type: su, data_id: 47

data_id in this case is the club_id

Example data for a player:

user_id: 12, type: pl, data_id: 833

data_id in this case is a player_id

---------------------

My colleague thinks that we should have an additional column.

Code:

members
user_id | club_id | type | data_id

View Replies !
BLOB Data To Store Binary Files
I am sold on the idea of using BLOB data to store binary files. I have created an application that accepts and HTML form HTTP header upload of an image file and stores it as BLOB data in my database.

I am now stuck because I can't get the data out of the BLOB field and use it as an image in an HTML file.

View Replies !
Store And Display Data Of Asian Languages
I properly store data in a table and retrieve that data properly from the table.

The data to be inserted in database table can be in English, Chinese, Spanish, Arabic, Hindi, Japanese etc.

The DB table would contain only one field/column to store that data.

Is there any solution regarding above scenario.

View Replies !
Yes OR No Data Type
Is there a yes/no boolean datatype with mySQL? I can't seem to find if there
is, and I have used an int type set to 1 or 0 but that breaks some of my
apps that used to use access which does have a yes/no field.

View Replies !
Which Data Type
I got a column in my database called 'section' and the probable values it's going to contain look something like 001, 002, 500, 488 4A, 676 7B, etc

Which data type(and size) should I use?

Currently I'm thinking of var(size) or varchar(size)

View Replies !
Yes/No Data Type
Does this exist in mySQL?

View Replies !
Importing Data Via Text File. Size Limit!
I am running mysql/php on my local machine (xp-pro). I am trying to import a lot of data into the database. I have about 50 thousand records. Here is a example of a recordset.

"13-01-103-007","32835 BRUGGEMAN","Warren Consolidated","95380","95380","94160","100.000","60.000","120.000","0.165","0","0","Apartment ","0","1.00","1307","C ","Brick ","1626","399","2","1626","1.00","0","1","1 Story","1980","A "

The fields are seperated by "," and enclosed by " "" ".
When I use phpmyadmin and limit the insert to about 30 records every thing works fine. But when I try to do the entire batch (50,000) it times out or I get a generic error "page can not be found" .

I noticed in phpmyadmin that the limit of file size is 2048kb. Could this be the problem? If so can I increase the size of the file? Mines is 14.9 MB. Or not have it timed out.

View Replies !
Text Data Type
Just how big a file can the Text data type contain (in kilobytes or Megabytes)? How big a file can a MediumText data type contain (in kilobytes or Megabytes)?

'Text' = 64 KB
'Mediumtext' = 16384 KB = 16 MB

There are a few bytes needed to store information about the field itself.

View Replies !
Data Type Question
I'm converting a desktop application Delphi/Paradox to a web server
application PHP/MySQL

What data type should I use in MySQL for the following paradox datatypes ?

Boolean ?
Currency ?

View Replies !
Float Data Type
I'm storing latitude and longitude, and i need numbers in the format xxx.xxxxxxxxxxxxxxx

I've tried setting it to float(3,15) in phpMyAdmin, but the numbers default to something else, and the resultant storage is slightly off when viewed on the map so i just left it as a blank float default, which works ok, but I don't think it's a perfect solution.

View Replies !
Longblob Data Type
actually what information is kept in longblob data type?
i've tried to upload image and save it in longblob.
is it only the file link saved in the longblob?
if i move the location of the saved image, it won't be able to display when my page load, rite?

View Replies !
Bolean Data Type
Why is bolean data type not present in MySQL 4.1.x?

View Replies !
What's The Best Way To Convert A Data Type?
I have a column of type Text in a table, but when my client software (C# .NET application) is calling the SELECT statement, it doesn't seem to know how to handle Text. What's the best way to convert the column to a Char or something like that in the SELECT statement?

I tried CAST(column_name AS CHAR) but it doesn't seem to be actually casting if more than one record is returned (works fine for just one record though). Any ideas?

View Replies !

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