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




Store Collection In MySQL


I have the following objects:

Article - Name, CreationDate, Auther, URL.
Users - FirstName, LastName, email, BirthDate.

I would like to create a favorite folder - so that each user can have a list of articles that are his favorites ones.

Each time the user login to the site he should see the list of his favorite articles.

In java I will save this list in a collection (e.g. Vector or Array). What is the best way to save it in the MySQL DB? Which data type should I use?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Store Jpg In MySQL?
How do I store pictures in mySQL? What is the data type for this field?

What Is The Best Way To Store XML File In MySQL?
I would like to store XML files in MySQL. What is the best solution:

1. Convert it to string and store it as CLOB/text
2. Serialize it and store as byte array
3. Flatten it out and create one column per element, each column is VARCHAR

Mysql To Store File
If i use mysql to store the file. How can i make a link for the
user to download that file?

MySQL With Store Procedure...
How to create Store Procedure on MySQL 5A ?
When I try to create the SP, but always error

"You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near ....."

But it very simple like,

CREATE PROCEDURE test1(OUT)
BEGIN
   USE Mysql;
   SELECT * FROM db;
END

And how to execute from sqlquery analyzer(like SQL Server)..

What Is The Best Way To Store A Date In MySQL DB?
I have a table (contacts) with a list of people I know. It holds info like email address and birthdays. Right now, I have the birthday saved across three fields- day, month, and year. The day and month fields hold values like '02' and the year field holds a four-digit number, like '2007'.

I know MySQL has a 'DATE' field type, and I would feel that is probably the best way to store the information I have.

My question is this:
I have some PHP code that checks to see if any of my contacts has a birthday today (as seen below)

$today = date("d/m");
$query = "SELECT * FROM `contacts` WHERE CONCAT(DAY,'/',MONTH) = '".$today."'";

How could I do this if I stored the date in a single, YYYYMMDD field?

Anyway 2 Store Files On Mysql?
anyway 2 store files on mysql? liek a text file something?

Can MySQL 4.0.14 Store HTML
You need the following:

Database
Web Server
Server-Side Scripting Language

I would suggest using AMP (Apache, MySQL & PHP). If you want to know more
about how these work in conjunction I would suggest the excellent book:

"Web Database Applications" by Oreilly.

It is the perfect beginners guide for this area.

Store Images In MySQL
I've looked around a bit before posting this, and overall I've discovered the means to store an image in a table via blobs, and take it back out and use it with PHP. I've discovered many users giving detailed descriptions as to why this is not a good idea, and overall I agree, BUT! I've been having the PHP problem where if I upload a file and store it onto my server with a form, the permissions are set such that nobody can delete those files aside from the superuser.

I suppose this is more a PHP question, in that I am asking how I should store a file such that I can have access to delete this file later, or if I should just try to store the file in SQL?

Store Images In MySQL
I'm new to MySQL and wanted to know if I could store the images in the DB...not the location but the images.
How can I do it?
I need this info. urgently..

using the blob or mediumlob column type is fine but how do I transfer the images to tables?

Records MySQL Can Store
How many records MySQL can store?& How many records Access can store?

Store Chinese Character In Mysql
My site is 90% english, however there are some pages that i need to display in chinese character. In fact, arabic, russia, spanish. In mysql, i try to use collation utf8_general_ci . So when i input the data using phpmyadmin, i type chinese character e.g •Ÿ(lucky) into the record, save it. Unfortunately when i use php to get the data from mysql database and present it on the web, it appear as '?' (question mark). How do i show it on the web correctly ?

How To Use Trigger And Store Procedure In Mysql?
I am using mysql 4.0.20. Based on my knowlegdge, trigger and store procedure feature is not avialable for this version. However, I really need them to fulfill a task, which is to automatically export data to a file when there is new record instert. Is there a way to do it in version 4.0.20? Need your help urgently!

Trying To Store A Password In Mysql Table
Not certain if thats the right way...i changed the function to PASSWORD and it encrypted it, but when i'm trying to match the password with the encrypted one, it doesn't work.

i've been looking online and see that the password function in mysql may not do what i need. i'm looking for extra security, that's why i wanted it.

How Do I Store Variables In A MySQL Table?
I want to create a table that has a newsletter that will get emailed out to clients. In the table, I want a field for the Subject, and one for the Body. In the Subject line, I need to include a personalization variable, such as "$firstname".

In the Body content, I need to store several personalization variables. How do I store the variable name when I insert the newsletters into the table? For example, the Subject line may be: "$firstname, Here is the info I want to send you". In the body, I may have something like:

"Presented to: $name"
"From: $my_name"
"$company_name"
"$company_phone"

etc...

When I load the newsletter, I just want to store the variable names, not any content. When I open the table to load the newsletter, I need to then substitute the variable names with the true names and other content.

MySQL Store Multimedia Files
I am hiring a programmer to build an application that will serve and store multimedia content.  It will need a database backend and I am wondering if MySQL can store multimedia (audio and video) files or if it is not powerful enough.

Also, are other database options better suited to this need?

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

Question About Using Different Folders To Store Mysql Table
By default mysql schemas and tables are stored in the 'data' folder of mysql. Is it possible to store it under other foders in windows xp ?

How To Store Images In Mysql Data Base
how to store images in mysql.

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.

Is Mysql Version 4.1.11 Support Store Procedure
is mysql version 4.1.11 support store procedure?

How To Store Large Files In MySQL (Eg. 12MB)
What are the configuration changes I have to do for storing large files in the mysql databases.

I want to store large files of size 12MB to 20MB.

I am using MySQL 4.0.18 in SuSeLinux 8.2.

I tried to do changes in /etc/my.cnf file such as to increase max_allowed_packet size to 21MB but I don't find that file.

Read Excel Datas And Store In Mysql Table
In a button click, i have to read datas from excel sheet and store it in mysql database table. Code:

Can A MySql Database Store A Long Paragraph Of Text
Can a MySql Database Store a long paragraph of text, If it can, how do you go about doing this. And how many "CHARS" can you store in a "FIELD".

The Most Optimize Way To Store And Seach Chinese Character In MySQL 4.1
Currently i store the chinese character in unicode decimal format
(&#<number>;). In this way, I can display and search the chinese
character correctly. However, this will take more storage space. Is
this the most optimize way?

For Better Performance :: Should I Store Word Files In MySQL Or In Normal Folders ?
I am working on a web application and part of it is functionality

is that the user can upload a PDF / DOC file as part of his account info .

should i store that file in the MySQL DB or in a normal folder in the server ?

which is the best for performance ?

i read some text in some site that says:

How To Store Chinese Chars And Also Italian, French And English In Mysql ?
I'm not able to store chinese characters into a column in a table....

how should the db setted and the table created to be able to store
different chars like chinese, french, italian and english ?

Store American DATE Formate( Like 27-02-2007) In Mysql Table
i need to know desperately the way of storing american DATE formate( like 27-02-2007) in mysql table.i searched on the web a lot,but didnt find anything

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!

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?

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?

Date Format Store In Mysql Table Likes Oracle Format( Dd-mmm-yyyy)
Can you store date in MySQL likes oracle format (dd-mmm-yyyy) ?

Store Friend Matrix In MySQL (was "Need Help In MySQL")
I am making an website for dating online. Each members can have a list of friends. If I have n members in my website, each member can have max of n friends so we have a nxn matrix (dimensions of the matrix are certainly variable. They are changed as time goes). Right? And my problem is how to store the matrix in MySQL (I need a DB structure to store it, it can be changed later so it must be easy to modify: edit, add, remove items/cells). Who has a good solution for this problem?

How To Store &quot;≤&quot; (less Or Equal To) Into Mysql As Is?
I need to insert some data from excel sheet to mysql tables. Characters like "≤" (less or equal to) turn out to be question marks, after they are inserted.

Store PDF In DB?
I am writing a web application that is actually an application for a school, causes some word confusion...
Anyway, applicants need to be able to upload PDF statements and letters of recommendation and such. The applicant can re-upload the file multiple times with corrections, but only the most recent version will be kept. When the application is finished the PDF will be accessed a few dozen times by various reviewers.
For easy backup/maintenance/organization it would make my life much simpler to store the PDFs directly in the database, however I gather that there may be problems with this. The only stats I can find seem to worry about scaling with dynamic content being loaded for thousands of visitors, however I don't need to worry about that as only a few dozen folks will want to view any given file, over several weeks.
Aside from scaling is there any other reason to avoid storing the PDFs in a BLOB? Will the performance hit be that significant?

How To Store
An user fills a form. My script generates a reference, call it REF. There's also another value which is the same for each REF, call it REF2. The script also generates a date value, which should be stored for each form filled and may have different values for the same REF, call it DATE. Then there's three more values which are come from what's filled in the form, so values may vary for the same REF, call them VAR1, VAR2 and VAR3. When I search the database, I will look for REF.

To sum up, each REF2 is always the same for one given REF; and DATE, VAR1, VAR2 and VAR3 need to be findable when I have the REF value.
By the way, all of these are VARCHARs (but for DATE which is a, well, DATE).

The Best Way To Store Sub Categories
I am setting up a system where users can select a main department and then a sub-category of that department. I currently have a department table that holds the main departments.

=============
id | department |
=============

If I put the sub-categories in the same table I am not sure of how to relate them to the main department. Is the best solution to put the sub-categories into another table with a department id column to reference the main department.

==========================
id | sub-category | departmentID |
==========================

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

How Do You Know WHEN To Use STORE PROCEDURE
I need to execute sql and pass two application variables' values to sql, so that every row of record, with field commission, is summed with two additional app variable values.

Do I need stored procedure?

Best Way To Store PRICES In DB
Should I use INT, DECIMAL, CHAR? to store a prices in the database?

Store SQL Procedure
I need to log all sql statments that are performed on a database using PHP, and so i am playing on storing them in a mysql table. Is there a way that i can store a sql statement without it trying to execute?

Store A Number
How do i store a number into MySQL and then reacal it later for use and/or editing.

Store DB For Each Domain
if there is a way to set up MySQL server to keep DB's for one user in it's home folder?

I wonder how those virtual (shared) hosting companies set it up?

What I mean is say if I have two users (domains) on the server they will have all their files in their home folders.

/home/domain1.com/
/home/domain2.com/

I ask this because I find it neat to have all the files for one domain in one place - mostly for backup.

Format To Store IP
I need to keep a database of IPs and check if a new IP is there or not.
I was wondering what's the most efficient way to store an IP in a database to make searching most efficient. Would it be better to hash the IP or just keep it as it is or some other way perhaps?

Store A Select
For instance, I have;

@a:=(SELECT * from @n)


@n is the variable that has the name of the table inside.

Is this possible?

Store An Array
I'm using PHP to acces my MySQL database; Now, I would like to store an array in the database. I was very suprised to see that there is no array-type field (samen with boolean? why didnt they make a boolean field?!). Anyone an idea how I can save and recover my array from the db

Store Images
its better to store the image in the DB(mysql) or only store the direction where the image is uploaded... im using php to upload the image.

Store An Array
I would like to be able to store numerical array in MySQL. I am really
looking for the solution to store it in the one field only.
For example, I have a matrix, which I want to store in the table, but
I don't want to create one column per matrix element - too many
columns or matrix size could change easily.

Should I convert all elements from numerical type into string and
create one long string with element separators or it is better to
serialize the whole array and write it as a byte array? What other
options are available?I know Oracle allows to store the array directly in the DB. How MySQL approaches this problem?

Store Images
i'm just changing from openbase SQL to MySQL, so i'm new here.
in openbase i had images stored in a database. the 'type' was set to
'object'.
i can't find something like that here and also not in the manual.
what should i use

Store Quary
Hi, im all new to this database stuff and on Lynda.com course i heard that it is not possible to store quary in mysql database. Is this really true, is there no way around it? Why is it so? How can experienced developers put up with this


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