Please help with my quicktime code

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
widdi
Forum Newbie
Posts: 6
Joined: Sun Sep 11, 2005 1:36 pm

Please help with my quicktime code

Post by widdi »

feyd | Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]


Hi - I am very new to php

I just need to use a mysql table to give me the "path" of a quicktime VR movie

so the movies are in say the folder tours - and the database has the path.

all I want is similar to this here
Can anyone please pick my beginers code an see what Ive done?

It is just making a template page while taking the path of the quicktime VR file from the mysql database - but doesn`t work yet!??!

thanks in advance
this is my crappy code:

Code: Select all

<?php
include_once("conf.php");
$link = mysql_connect($dbserver, $username, $password) or die("Could not connect: " . mysql_error());
mysql_select_db("MYDATABASE",$link) or die ("Can\'t use dbmapserver : " . mysql_error());

/* Performing SQL query */

$query = "SELECT * FROM MYFOLDER";

$result = mysql_query($query) or die("Query failed");


echo '<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
WIDTH="400" HEIGHT="500"
CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">
<PARAM NAME="src" VALUE=" . $row['url'] . ">
<PARAM NAME="correction" VALUE="full">
<EMBED SRC=" . $row['url'] . " CORRECTION="full">
</OBJECT>';


?>
:(


feyd | Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

first off, you weren't stepping out of the string when adding your variables.. next, you were missing at least one mysql_fetch_*. You may need to specify a WHERE clause for your $query so it can find a specific record, otherwise you're just going to use the first record it finds...

Code: Select all

<?php
include_once("conf.php");
$link = mysql_connect($dbserver, $username, $password) or die("Could not connect: " . mysql_error());
mysql_select_db("MYDATABASE",$link) or die ("Can\'t use dbmapserver : " . mysql_error());

/* Performing SQL query */

$query = "SELECT * FROM MYFOLDER";

$result = mysql_query($query) or die("Query failed");

$row = mysql_fetch_assoc($result);
echo '<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
WIDTH="400" HEIGHT="500"
CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">
<PARAM NAME="src" VALUE="' . $row['url'] . '">
<PARAM NAME="correction" VALUE="full">
<EMBED SRC="' . $row['url'] . '" CORRECTION="full">
</OBJECT>';


?>
widdi
Forum Newbie
Posts: 6
Joined: Sun Sep 11, 2005 1:36 pm

Cheers

Post by widdi »

I wish I knew what you meant!!

:(


I am really out my depth - but just need to do this.

eg field in mysql - id1 has http://www.flash360.net/glastonbury/tours/1/1.mov as a path

I need to just choose the id in the browser eg ?id=2 (please tell me if i`m wrong?)

thanks in advance
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

take the code I posted, changing

Code: Select all

$query = "SELECT * FROM MYFOLDER";
to

Code: Select all

$query = "SELECT * FROM MYFOLDER WHERE `id` = '".mysql_real_escape_string($_GET['id'])."'";
widdi
Forum Newbie
Posts: 6
Joined: Sun Sep 11, 2005 1:36 pm

brill

Post by widdi »

thankyou for your help - it was great!!
Post Reply