Results 1 to 2 of 2

Thread: Adding streams manually to the database

  1. #1

    Adding streams manually to the database

    I have downloaded and installed the script without any problem, but after using it and playing around for a while in the admin area i decided to add some new channels.

    I added some via the admin area but wondering how easy it would be to add a channel by using mysql?

  2. #2
    Administrator admin's Avatar
    Join Date
    Dec 2010
    Posts
    1,049
    Hi Bob,

    By far the admin panel is the easiest way to add channels as that supplies the right fields to add to the database, but you can do it manually if you want.

    I presume you mean you would like to add channels via a php script and add it using mysql, if so read on.

    first we will include config.php to pick up the database info, then we make a connection and open the db.

    PHP Code:
    include("config.php"); //Included to pickup your db info
    mysql_connect($dbhost$dbuser$dbpass) or die (mysql_error());
    mysql_select_db($dbname) or die (mysql_error()); 
    Next we set up the variable to hold our channel info.

    PHP Code:
    $channel="the channel name";
    $streamurl="the url to the actual stream"//usually found in html embed and object code
    $country="the country the channel is from";
    $category="the category the channel belongs to";
    $discription="a short discription for the channel";
    $player="the player type to use"//either wm or fp for now 
    Next comes inserting our new channel into the database.

    PHP Code:
    $query "INSERT INTO tvchannels (`tvid`, `channel`, `streamurl`, `country`, `category`, `discription`, `player`) VALUES (NULL, '".$channel."', '".$streamurl."', '".$country."', '".$category."', '".$discription."', '".$player."')";
    $result mysql_query($query) or die (mysql_error()); 
    That is how you would use php and mysql to add a channel.

Visitors found this page by searching for:

add video in admin panel database query

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •