advice needed on whether this is possible

  • tommya
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Mar 17, 2004
  • Posts: 221
  • Loc: United Kingdom
  • Status: Offline

Post July 2nd, 2004, 3:26 am

hi all, I was just after a bit of advice on how to go about setting up a particular MySQL database - and even if its possible to write a PHP front end for it.

We have a number of kit inserts on our network, that the admin girls have to go and look for and attach to email

I would like to devise some kind of system, whereby they can search for the kit insert number.

It would list all the inserts that matched the string entered and display a tick box next to each resulting match.
Then they could tick whichever boxes they wanted and it would go off and attach the ticked inserts to an email

does this sound viable? is it possible?

Cheers everyone

Tommy
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post July 2nd, 2004, 3:26 am

  • rjstephens
  • Professor
  • Professor
  • User avatar
  • Joined: Jul 28, 2003
  • Posts: 774
  • Loc: Brisbane, Australia
  • Status: Offline

Post July 2nd, 2004, 5:11 am

that is not too difficult to do. PHP/MySQL is ideal for that type of job.

To search them do a sql query something like:
select kit_id, kit_data
from kits
WHERE kit_data LIKE '%SEARCH TERM%'

the WHERE part is the important part as far as searching them is concerned.
  • tommya
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Mar 17, 2004
  • Posts: 221
  • Loc: United Kingdom
  • Status: Offline

Post July 2nd, 2004, 5:14 am

cheers,

I'm aware of the "where" part but what really makes my head spin is where do I store the actual inserts themselves? Can they somehow be stored inside of the database?

What I mean is, if 1 row consists of kit name, kit id - then can a third column be the actual file itself

Hope that makes sense
  • tommya
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Mar 17, 2004
  • Posts: 221
  • Loc: United Kingdom
  • Status: Offline

Post July 2nd, 2004, 5:15 am

and I guess the biggest thing is, how do I get it to attach to an email?
this involves interaction with outlook and well beyond my current scope
  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Joined: May 21, 2004
  • Posts: 3229
  • Loc: South Africa
  • Status: Offline

Post July 2nd, 2004, 5:22 am

Just create the form, have a text box so tyhe e-mail it needs to go to can be entered and click send.

The PHP mail function will deal with the e-mailing (if you format it correctly you can attach the kit as well).

No need to do anything with outlook.

As for storing the file in the database it is a bit more complicated but I am sure it can be done.

There you go, storing binary data in MySQL,
http://www.phpbuddy.com/article.php?id=6
Watch me grow
  • rjstephens
  • Professor
  • Professor
  • User avatar
  • Joined: Jul 28, 2003
  • Posts: 774
  • Loc: Brisbane, Australia
  • Status: Offline

Post July 2nd, 2004, 7:02 am

there is no need to deal with outlook, just use mail(), but I'm not sure how attachments are used with it. You'd have to look that up. But I'm sure it's not hard.

TO store files in a mysql database use a blob colum (or smallblob, largeblob, bigblob, etc. depending on how big the files are)

What format are the files in?
  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Joined: May 21, 2004
  • Posts: 3229
  • Loc: South Africa
  • Status: Offline

Post July 2nd, 2004, 7:09 am

And here you will find the ref for sending attachments with PHP mail

http://www.zend.com/zend/spotlight/send ... lpart1.php

Man I love PHP
Watch me grow
  • tommya
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Mar 17, 2004
  • Posts: 221
  • Loc: United Kingdom
  • Status: Offline

Post July 2nd, 2004, 7:45 am

thanks for those links

the files I'd need to use are approx 50k to 500k in size, so which should I use, or will any suffice
  • rjstephens
  • Professor
  • Professor
  • User avatar
  • Joined: Jul 28, 2003
  • Posts: 774
  • Loc: Brisbane, Australia
  • Status: Offline

Post July 2nd, 2004, 7:52 am

http://dev.mysql.com/doc/mysql/en/Strin ... rview.html

basically you have a choice between BLOB (which is limited at 64kb) and MEDIUMBLOB (which is limited at 16MB)

given that your max size is around 500kb, I would go for MEDIUMBLOB.

and btw if you store a 500kb in a mediumblob colum it only takes up (just over) 500kb - not the full 16MB max capacity.

Post Information

  • Total Posts in this topic: 9 posts
  • Users browsing this forum: No registered users and 243 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.