473,378 Members | 1,536 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

databases

Hi all,

i have to create a game for young children aged from 6 -14 years old. the
game will aid them to learn a new language easily. there will be a spelling
game and a photo game. the words and the pictures must be stored in mysql.do
u know how should i store a picture in mysql? what should i notice before i
create the tables? does anyone know a web site about the design of
databases?
Jul 17 '05 #1
7 1635
Nel
"Goofy" <ga**********************@durham.ac.uk> wrote in message
news:cf**********@heffalump.dur.ac.uk...
Hi all,

i have to create a game for young children aged from 6 -14 years old. the
game will aid them to learn a new language easily. there will be a spelling game and a photo game. the words and the pictures must be stored in mysql.do u know how should i store a picture in mysql? what should i notice before i create the tables? does anyone know a web site about the design of
databases?

Store filename in table and store images as files IMHO.

Nel.
Jul 17 '05 #2
On Fri, 06 Aug 2004 21:01:26 +0100, Nel wrote:
"Goofy" <ga**********************@durham.ac.uk> wrote in message
news:cf**********@heffalump.dur.ac.uk...
Hi all,

i have to create a game for young children aged from 6 -14 years old. the
game will aid them to learn a new language easily. there will be a

spelling
game and a photo game. the words and the pictures must be stored in

mysql.do
u know how should i store a picture in mysql? what should i notice before

i
create the tables? does anyone know a web site about the design of
databases?

Store filename in table and store images as files IMHO.

Nel.

Yes! definitely!! =)

I wrote a post on the Smarty forum after discussion with boots there about
some issues and pitfalls I encountered while storing files in a database.
I attempted it out of curiousity (every other upload script etc has always
stored files in the filesystem) and after spending a fair few hours on it,
reverted back to filesystem storage.

Many ideas were tested, but nothing compares to physically storing files
and relative info only in the DB.

Regards,

Ian

--
Ian.H
digiServ Network
London, UK
http://digiserv.net/

Jul 17 '05 #3

"Ian.H" <ia*@WINDOZEdigiserv.net> wrote in message
news:pa****************************@bubbleboy.digi serv.net...
On Fri, 06 Aug 2004 21:01:26 +0100, Nel wrote:
"Goofy" <ga**********************@durham.ac.uk> wrote in message
news:cf**********@heffalump.dur.ac.uk...
Hi all,

i have to create a game for young children aged from 6 -14 years old. the game will aid them to learn a new language easily. there will be a

spelling
game and a photo game. the words and the pictures must be stored in

mysql.do
u know how should i store a picture in mysql? what should i notice
before i
create the tables? does anyone know a web site about the design of
databases?

Store filename in table and store images as files IMHO.

Nel.

Yes! definitely!! =)

I wrote a post on the Smarty forum after discussion with boots there about
some issues and pitfalls I encountered while storing files in a database.
I attempted it out of curiousity (every other upload script etc has always
stored files in the filesystem) and after spending a fair few hours on it,
reverted back to filesystem storage.

Many ideas were tested, but nothing compares to physically storing files
and relative info only in the DB.

Regards,

Ian

--
Ian.H
digiServ Network
London, UK
http://digiserv.net/


This is by far the simplest way, and most flexible. While the database CAN
store the files using BLOB (mysql anyway) it is not a very good way to go in
anything I have done. Instead, I save the paths to the files, or some
portion of the path and file name, in the database and build the links and
references from that information. Works very well and allows the database
to stay slimmed down. It only seems more complicated, but in the end, it
isnt.

Jul 17 '05 #4
Goofy wrote:
Hi all,

i have to create a game for young children aged from 6 -14 years old. the
game will aid them to learn a new language easily. there will be a spelling
game and a photo game.


it is online?
is english-italian?
there are other similar online (english-italian)?
Jul 17 '05 #5

? "provaands" <in**********@tucossa.it> ?????? ??? ??????
news:UP*********************@news3.tin.it...
Goofy wrote:
Hi all,

i have to create a game for young children aged from 6 -14 years old. the game will aid them to learn a new language easily. there will be a spelling game and a photo game.


it is online?
is english-italian?
there are other similar online (english-italian)?


it will be on-le and yes it is english? do u know if i can find anywhere
similar script for that?
Jul 17 '05 #6

Ο "Doug B" <ye**@right.com> έγραψε στο μήνυμα
news:fG******************@fe58.usenetserver.com...

"Ian.H" <ia*@WINDOZEdigiserv.net> wrote in message
news:pa****************************@bubbleboy.digi serv.net...
On Fri, 06 Aug 2004 21:01:26 +0100, Nel wrote:
"Goofy" <ga**********************@durham.ac.uk> wrote in message
news:cf**********@heffalump.dur.ac.uk...
> Hi all,
>
> i have to create a game for young children aged from 6 -14 years
old.
the> game will aid them to learn a new language easily. there will be a
spelling
> game and a photo game. the words and the pictures must be stored in
mysql.do
> u know how should i store a picture in mysql? what should i notice before i
> create the tables? does anyone know a web site about the design of
> databases?
>
Store filename in table and store images as files IMHO.

Nel.

Yes! definitely!! =)

I wrote a post on the Smarty forum after discussion with boots there about some issues and pitfalls I encountered while storing files in a database. I attempted it out of curiousity (every other upload script etc has always stored files in the filesystem) and after spending a fair few hours on it, reverted back to filesystem storage.

Many ideas were tested, but nothing compares to physically storing files
and relative info only in the DB.

Regards,

Ian

--
Ian.H
digiServ Network
London, UK
http://digiserv.net/


This is by far the simplest way, and most flexible. While the database

CAN store the files using BLOB (mysql anyway) it is not a very good way to go in anything I have done. Instead, I save the paths to the files, or some
portion of the path and file name, in the database and build the links and
references from that information. Works very well and allows the database
to stay slimmed down. It only seems more complicated, but in the end, it
isnt.

do u know how should save the paths and file name in the database? is there
any tutorial? because i only know how to store text in the database. how
should i build the links and references from that information? any on-line tutorial? and something else. which command should i use ( php) in order to retrieve these
information?

Jul 17 '05 #7
On Sat, 07 Aug 2004 17:42:41 +0100, Goofy wrote:
[ snip ]

do u know how should save the paths and file name in the database? is there
any tutorial? because i only know how to store text in the database. how
should i build the links and
references from that information? any on-line tutorial? and something

else. which command should i use ( php) in order to retrieve these
information?

I'd store just the filename (grab this value from
$_FILES['field_name']['name'] (where 'field_name' is the name of your form
element).

Unless you have a highly configurable site where the upload directory
maybe dynamic, you could just define the dir and concatenate to create the
full path:
[ upload.php ]
<?php
/**
* If upload.php is in your Web root, this would prevent
* files being accessed directly without going through a script
*/
define('UPLOAD_DIR', dirname(__FILE__) . '/../files/');

$filename = $_FILES['upload_file']['name'];

/**
* Do bulk of processing
* [ ... ]
*/
if (move_uploaded_file($src, UPLOAD_DIR . $filename) {
/**
* Store $filename in database
*/
}
?>
[ download.php ]
[ example link: foo.com/download.php?id=1 ]
<?php
define('UPLOAD_DIR', dirname(__FILE__) . '/../files/');

/**
* Grab filename from database
* that matches ID #1
* (Assuming $row is your assoc array from DB)
*/
$filename = $row['filename'];

/**
* Send headers etc (see php.net under 'header')
*/
header('Content-type: application/octet-stream');
/* etc etc etc */

@readfile(UPLOAD_DIR . $filename);
exit;
?>
This is a really quick outline of how I normally do things (please note
the lack of validation in this example code) but it works pretty well.

You may want to define more info like a list (array) of mime-types
according to file extension and making the above header() call relative to
the mime-type rather than sending everything application-octet-stream:
$mimeTypes = array('
'zip' => 'archive/x-zip',
'jpg' => 'image/jpeg'
);
for example.. but there's lots you can play with maybe once you have the
base of the code sorted =)
HTH.

Regards,

Ian

--
Ian.H
digiServ Network
London, UK
http://digiserv.net/

Jul 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Gary L. Burnore | last post by:
REQUEST FOR DISCUSSION (RFD) unmoderated group comp.databases.mysql This is an invitation to discuss the following proposal to create newsgroup comp.databases.mysql. Please note that YOU CANNOT...
8
by: William Drew | last post by:
REQUEST FOR DISCUSSION (RFD) unmoderated group comp.databases.mysql This is an invitation to discuss the following proposal to create newsgroup comp.databases.mysql. Please note that YOU...
0
by: Cara | last post by:
LAST CALL FOR VOTES (of 2) unmoderated group comp.databases.etl Newsgroups line: comp.databases.etl Extraction, transformation, loading issues. Votes must be received by 23:59:59 UTC, 12 Dec...
1
by: Hai-Chu Hsu | last post by:
Hi, I want to restore my databases from the old SQL Server installation into a new installation of SQL Server. My new installation of SQL Server has different data path from the old...
0
by: Cara Altman | last post by:
REQUEST FOR DISCUSSION (RFD) unmoderated group comp.databases.etl This is a formal Request For Discussion (RFD) for the creation of a world-wide unmoderated Usenet newsgroup...
3
by: Amit | last post by:
Hi when I try to run LIST ACTIVE DATABASES AT DBPARTITIONNUM <partnum> or LIST ACTIVE DATABASES GLOBAL, I always get an error message. Does anyone know why? I'm on v8 fp 5 output : db2 => list...
1
by: com | last post by:
Extreme Web Reports 2005 - Soft30.com The wizard scans the specified MS Access database and records information such as report names, parameters and subqueries. ......
6
by: Andy | last post by:
Someone posted this official proposal to create comp.databases.postgresql.general again. He wrote his own charter. As far as I know, he did not consult any of the postgresql groups first. There...
6
by: Tjerk Wolterink | last post by:
Don't know wether this is the right newsgroup, anyways: Has anyone some experience with Native XML Databases. Im planning to use this: http://exist.sourceforge.net/ It has many advantages...
3
by: AK | last post by:
Hi Our product uses MS-SQL Server 2000. One of our customer has 10 installations with each installation stroring data in its own database. Now the customer wants to consolidate these databases...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.