Page 1 of 1

Please help with my quicktime code

Posted: Sun Sep 11, 2005 1:53 pm
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]

Posted: Sun Sep 11, 2005 2:05 pm
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>';


?>

Cheers

Posted: Sun Sep 11, 2005 2:15 pm
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

Posted: Sun Sep 11, 2005 2:22 pm
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'])."'";

brill

Posted: Sun Sep 11, 2005 3:18 pm
by widdi
thankyou for your help - it was great!!