PDA

View Full Version : playing mpeg clips from a MySQL database - how?


jool
03-03-2006, 11:37 AM
Hello all,

I have created a MySQL database containing profiles (records) of teacher details.

Potential students are able to browse through the teacher profiles online. This can be viewed at:
http://www.orangutanjapan.com/NewMemberTeacherProfile-1.php?language=&prefecture=&Submit=%92T%82%B7

Now, what I'd like to do is add short MPEG video clips to these profiles. I have the location (path) of the videoclip stored in the database, and when that path is clicked, the video plays in realplayer. I could place the full path on the profile, and then the user could click on that, and it would open the clip in real player, but having the whole path displayed on the profile looks rather ugly, and I'd prefer to do it a different way.

What would be best would be to have some simple text such as 'Video clip available' if there was a path to a file for that particular record and if there was no path (i.e. no available video) then no text would appear.

This is how I imagine would be the best and easiest way to attach short MPEGs to records in an SQL database. If anybody can help me with this or knows any better way of doing this - I'd be really grateful.

Many thanks

Jool

davidj
03-03-2006, 01:05 PM
i do this allot but with scanned images (tif, doc, pdf)

i store these on a dir ouside the root of the site and do a copy to a temp dir

as the user logs in i can utilise the user session when making up the name for my copied file.

example...

$from=sprintf("%s%s",$path,$filename);

if (file_exists($from)){
$to=sprintf("%s%s%s",$tmppath,$_SESSION['MM_Username'],$filename);
copy($from,$to);
header("location: $to); }
this copies the file to a tmp dir in your root which you can link to directly

if you need a step by step then let me know

jool
03-04-2006, 08:35 AM
Hi Davidj

Many thanks for your answer, and sorry for not responding sooner to your email.

I can't really write code and usually do everything through the dreamweaver interface so I'm not sure exactly if I follow what you've told me.

I'd really appreciate that step by step if possible.

Many thanks,

Jool

D7
03-06-2006, 02:01 AM
<suggestion>
<suggests>Perhaps you might want to try xml for this </suggest>
<also>It might provide you a friendly way to handle it</also>
<though>It is just a though. Good luck!< /thought>
</suggestion>

davidj
03-06-2006, 07:48 AM
I can't really write code and usually do everything through the dreamweaver interface


well nows your chance to break out of the kinder garden and move into the big boys school...

if you need help with this i should be able to guide you through it..