Activity Stream
48,167 MEMBERS
6839 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 10 of 10
  1.     
    #1
    Member
    Website's:
    porndex.eu massprchecker.com

    Question Mysql fetch specific data from row (id)

    Ok so im not very good with all this mysql stuff but im having a go.

    I have built a script that inserts into my DB the following:

    Video Link (playable mp4,avi etc etc)
    Video Title
    Video download link

    I now have my output done BUT im using the echo command to pull the media link from my DB into the media player

    Example:


    Code: 
    <OBJECT ID="MediaPlayer" WIDTH="192" HEIGHT="190" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
    STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject">
    <PARAM NAME="FileName" VALUE="<?php echo("$vid_source"); ?>">
    <PARAM name="autostart" VALUE="false">
    <PARAM name="ShowControls" VALUE="true">
    <param name="ShowStatusBar" value="false">
    <PARAM name="ShowDisplay" VALUE="false">
    <EMBED TYPE="application/x-mplayer2" SRC="<?php echo("$vid_source"); ?>" NAME="MediaPlayer"
    WIDTH="192" HEIGHT="190" ShowControls="1" ShowStatusBar="0" ShowDisplay="0" autostart="0"> </EMBED>
    </OBJECT>

    Now this works fine and plays the video BUT all the movie players play the same video so i need to use something like

    Code: 
    <?php echo("$vid_source from $id1"); ?>
    Now of coarse this dosn't work and i didnt expect it to......so what do i put in there so it pulls the links from the diferent rows/id's from my DB.


    Thanks
    RR
    roadrunner Reviewed by roadrunner on . Mysql fetch specific data from row (id) Ok so im not very good with all this mysql stuff but im having a go. I have built a script that inserts into my DB the following: Video Link (playable mp4,avi etc etc) Video Title Video download link I now have my output done BUT im using the echo command to pull the media link from my DB into the media player Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    first of all you have to get the id of the video using $_GET from the user.
    You can do something like this:

    $id = $_GET['videoid'];
    $sql = "SELECT * FROM table WHERE id={$id}";
    $query = mysql_query($sql);
    while($result = mysql_fetch_array($query)){
    echo $result['id'] . $result['videolink'] . $result['videotitle']
    }

  4.     
    #3
    Respected Member
    Website's:
    DL4Everything.com Soft2050.in
    Give an example link to your website

    Get the data by input get in a variable

    Then connect to the mysql database and use "MySQL Select" to select the row and then fetch the variable from that row

    About MYSQL Select:

    http://dev.mysql.com/doc/refman/5.0/en/select.html
    http://www.w3schools.com/PHP/php_mysql_select.asp

  5.     
    #4
    Member
    Website's:
    porndex.eu massprchecker.com
    Thanks for the quick response.

    Take a look here ( ignore the cosmetic side at the moment please):

    http://userporn.co.uk/new_site/out2.php

    You will see from the text output there are 2 diferent MP4 links

    But the media players only play the last one....

    Here is my DB :



    So i need to make this :
    Code: 
    <?php echo("$vid_source"); ?>
    echo the diferent links from the diferent ID's

    Cheers
    RR

  6.     
    #5
    Respected Member
    Try this:
    PHP Code: 
    <?PHP
    $user_name 
    "DbUserName";
     
    $password "DbPassword";
     
    $database "DbName";
     
    $server "localhost";

    $db_handle mysql_connect($server$user_name$password);
    $db_found mysql_select_db($database$db_handle);

    if (
    $db_found) {

    $SQL "SELECT vid_source FROM DbTableName";
    $result mysql_query($SQL);

    while (
    $db_field mysql_fetch_assoc($result)) {
    echo 
    $db_field['vid_source']."<br>";
    }

     
    mysql_close($db_handle);

    }
    else {
    echo 
    "Database NOT Found ";
    mysql_close($db_handle);
    }

    ?>

  7.     
    #6
    Member
    Website's:
    porndex.eu massprchecker.com
    Tryed that, it printed/echo'ed the 2 links but the media players stopped playing

  8.     
    #7
    Member
    Website's:
    porndex.eu massprchecker.com
    Perhaps its not possible to pull a specific bit of info from a specific row of a table ?

  9.     
    #8
    Member
    ofc it is possible, when you use mysql_fetch_array(); those info are placed inside the array, e.g.

    array['vid_source']

  10.     
    #9
    Member
    Website's:
    porndex.eu massprchecker.com
    Thanks all
    Have now got it sorted as you will see here:

    http://userporn.co.uk/new_site/

    Cheers
    RR

  11.     
    #10
    Respected Member
    You are welcome.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Problem my display data php mysql
    By softpk in forum Web Development Area
    Replies: 1
    Last Post: 22nd Apr 2012, 11:42 AM
  2. Replies: 0
    Last Post: 20th Dec 2011, 03:37 AM
  3. Replies: 1
    Last Post: 15th Nov 2011, 05:59 AM
  4. replacing mysql $link supplied data, a question?
    By XSLTel in forum Web Development Area
    Replies: 10
    Last Post: 23rd Jul 2011, 03:14 PM
  5. Fetching Data from mysql database (Well Commented)!
    By litewarez in forum Tutorials and Guides
    Replies: 3
    Last Post: 9th May 2009, 03:36 AM

Tags for this Thread

BE SOCIAL