Jump to content

[SOLVED] NEED HELP


semaj4712

Recommended Posts

I am a newbie to php mysql integration, and i have a question, im using a a php file that was pre made im just editing it, i want to link a movie to youtube this is what i have so far

 

function mostraRecensioni($row){
	global $cinConfig, $mainframe, $option, $Itemid, $id, $_MAMBOTS, $params;
	?>


<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/<?php echo $allvideosfonteid?>"</param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/<?php echo $allvideosfonteid?>" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>

 

i need it to recognize what jmovies id it is and then tell the code to insert that videos allvideosfonteid

Link to comment
Share on other sites

ok i have a script where on the back end i put in the youtube code, like H48DSlku like that, and then that adds it to a mysql database

 

and then from there i want to insert that part that into the code, and then open the movie, but i want to make sure it opens the right movie  so it also has to know what movie id to open how do i do that?

Link to comment
Share on other sites

You can insert it simply by using a mysql INSERT query.  You can build a fancy form if others are going to be submitting the videos, or you can just do it via phpMyAdmin or similar.

eg.

INSERT INTO table(col1,col2,col3) VAULES(val1,val2,val3)

 

You then need to query the database for the code, and simply plug it into the variable you already have.  I don't know how you are going to differentiate between videos so the right video code is retrieved from the DB - you'll have to work it out yourself I think.

Link to comment
Share on other sites

um ok its alot tho

 

<?php
/**
* @Jmovies - Un componente per Joomla
* @package Component for Joomla
* @subpackage jmovies.php
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @autor Vamba & Luscarpa
**/

# Per non permettere collegamento diretto
defined( '_VALID_MOS' ) or die( 'Accesso diretto non permesso.' );

if (defined('_CINEMA_HTML')) {
    return;
} else {
    define('_CINEMA_HTML', 1);
}



class HTML_cinema {

function cinHeader($title, $cattitleimg) {
	global $cinConfig, $option, $Itemid;
	?>
	<!-- Stili CSS layout -->
	<style>
		legend{ <?php echo $cinConfig['legend']?> }
		fieldset{ <?php echo $cinConfig['fieldset']?> }
		#fieldset{ <?php echo $cinConfig['fieldset2']?> }
		.legendtitle{ <?php echo $cinConfig['legendtitle']?> }
	</style>


more code


<?php
}

function mostraRecensioni($row){
	global $cinConfig, $mainframe, $option, $Itemid, $id, $_MAMBOTS, $params;
	?>


<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/<?php echo $allvideosfonteid?>"</param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/<?php echo $allvideosfonteid?>" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>


	<?php
}

}

?>

 

the part im working on is right at the bottom

Link to comment
Share on other sites

Maybe it's because I'm a noob. But it doesn't appear that any of your variables are registered. Such as $mainframe.  Is the bottom part supposed to send the youtube info to your db? If so, I would approach it completely differently. Maybe something like:

 

$sql = "INSERT INTO your table (place, table, rows, you, want, here) VALUES ($place, $table, $values, $you, $want, $here)";

$result = mysql_query($sql, $connection) or die(mysql_error());

 

of course to add this part you will need to include your database connection at the beginning of your script.

 

Let me know if this is helpful at all.

Link to comment
Share on other sites

Try this to get the info:

 

$sql = "SELECT someField from yourtable";

$result = mysql_query($sql, $conn) or die(mysql_error());

 

That will pull the info from your db. I still need to know what you want to do with the info after it gets pulled from the db. (Just displaying it on the page, sending it somewhere, making a link from the info,?)

Link to comment
Share on other sites

so say my table is jos_jmovies then and the field is allvideosfonteid

 

i would put...

$sql = "SELECT allvideosfonteid from jos_jmovies";
$result = mysql_query($sql, $conn) or die(mysql_error()); 

 

i want then to insert it into the code like this

<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/<?php echo $allvideosfonteid?>"</param>
<param name="wmode" value="transparent">
</param><embed src="http://www.youtube.com/v/<?php echo $allvideosfonteid?>" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350">
</embed></object>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.