View Full Version : Admin - update/edit channel and delete a channel not working

12-20-2010, 02:58 PM
add a channel is working fine but can't update/edit channel


Can't delete the channel...

can you fix it..??


12-20-2010, 10:09 PM

Can you give me some more info as to what the problem is? ie where the problem occurs..


12-21-2010, 11:27 AM
sir, i love your script and i m using it..
but the problem is when i go to admin section.. there are 4 options..
1) add a channel.. which is working fine.. No issue adding New channels
2). Update/edit Channel.. This section is not working.. i mean when i select a channel it shows me the channels property .. and when i make any changes in it and i click update. it is not updating the channels..
3). Delete a channel .. This option is not working as well.. when i select a channel to delete. it do no deletes the channel.

kindly check it out what's the problem.. i mean i can add the channel but option to update or edit the channel is not working..

for example..: visit this link http://tinyurl.com/tvadmin

and check it out.. every thing is fine but admin section's Edit/update and delete section is not working..

12-21-2010, 06:42 PM

Found the problem, heres how to fix it..

1 open admin/server.php
2 change on line 26, two of $row['tvID'] into $row['tvid']
3 save and upload.


12-22-2010, 11:38 AM



mysql_connect($dbhost, $dbuser, $dbpass) or die (mysql_error());
mysql_select_db($dbname) or die (mysql_error());
$query0 = "SELECT * FROM tvchannels WHERE channel = '".$q."'";
$query1 = "SELECT DISTINCT country FROM tvchannels WHERE country <> '' ORDER BY country";
$query2 = "SELECT DISTINCT category FROM tvchannels WHERE category <> '' ORDER BY category";
$query3 = "SELECT DISTINCT player FROM tvchannels WHERE player <> '' ORDER BY player";
$result0 = mysql_query($query0) or die (mysql_error());
$result1 = mysql_query($query1) or die (mysql_error());
$result2 = mysql_query($query2) or die (mysql_error());
$result3 = mysql_query($query3) or die (mysql_error());
while ($record1 = mysql_fetch_array($result1) ) { $records1[] = $record1; }
while ($record2 = mysql_fetch_array($result2) ) { $records2[] = $record2; }
while ($record3 = mysql_fetch_array($result3) ) { $records3[] = $record3; }

$row = mysql_fetch_array($result0);
if ($row) {
echo "<table width='100%' border='0' align='center' cellpadding='3' cellspacing='0' bgcolor='#CCF4FF'>";
echo " <tr><td bgcolor='#6AC4FF'>tvID:</td><td>".$row['tvid']."<input name='tvid' type='hidden' value='".$row['tvid']."' style='background-color:#E1F9FF' /></td></tr>";
echo " <tr><td bgcolor='#6AC4FF'>Channel:</td><td><input type='text' name='u1' value='".$row['channel']."' size='40' style='background-color:#E1F9FF' /></td></tr>";
echo " <tr><td bgcolor='#6AC4FF'>Country:</td><td>";

echo "<select name='u2' style='background-color:#E1F9FF'>";
foreach ($records1 as $rec){
if ($rec['country']==$row['country']){
echo "<option value='".$rec['country']."' selected='selected'>".$rec['country']."</option>\n";
echo "<option value='".$rec['country']."' >".$rec['country']."</option>\n";
echo "</select></td></tr>";

echo " <tr><td bgcolor='#6AC4FF'>Category:</td><td>";

echo "<select name='u3' style='background-color:#E1F9FF'>";
foreach ($records2 as $rec){
if ($rec['category']==$row['category']){
echo "<option value='".$rec['category']."' selected='selected'>".$rec['category']."</option>\n";
echo "<option value='".$rec['category']."' >".$rec['category']."</option>\n";
echo "</select></td></tr>";

echo " <tr><td bgcolor='#6AC4FF'></td><td></td></tr>";
echo " <tr><td bgcolor='#6AC4FF'>Stream URL:</td><td><input type='text' name='u5' value='".$row['streamurl']."' size='70' style='background-color:#E1F9FF' /></td></tr>";
echo " <tr><td bgcolor='#6AC4FF'>Player:</td><td>";

echo "<select name='u6' style='background-color:#E1F9FF'>";
foreach ($records3 as $rec){
if ($rec['player']=='wm') $pl="Windows Media Player";
if ($rec['player']=='fp') $pl="Flash Player";

if ($rec['player']==$row['player']){
echo "<option value='".$rec['player']."' selected='selected'>".$pl."</option>\n";
echo "<option value='".$rec['player']."' >".$pl."</option>\n";
echo "</select></td></tr>";

echo " <tr><td bgcolor='#6AC4FF'>Discription:</td><td><textarea name='u7' cols='55' rows='3' style='background-color:#E1F9FF' >".$row['discription']."</textarea></td></tr>";
echo " <tr><td align='right' colspan='2' bgcolor='#6AC4FF'>";

if($id=="edit") echo "<input type='submit' name='submit' id='submit' value='Update Channel' />";
if($id=="delete") echo "<input type='submit' name='submit' id='submit' value='Delete Channel' />";

echo "</td></tr>";
echo "</table>";

Sir this is the code in Server.php

Now Delete a channel option is working fine.. but still edit / update option is not working.. i can delet a channel but i can't edit a channel..

kindly check it please.

i m waiting for you quick response.
waiting for your answer..

12-22-2010, 05:15 PM
hi just checked your script and it working fine my end

went to edit / update chose (Beach) Bloemendaal

then renamed (Beach) Bloemendaal to (Beach) Bloemendaal ZZZ

went to display channels an (Beach) Bloemendaal is displaying as (Beach) Bloemendaal ZZZ as expected.

01-09-2011, 03:45 PM

I like your script but found most of the links are not working and most common channels are not there in the list. I tried to add the channel as well but not working even the steps are very much detailed in all the setup. I want to add Geo Tv from Pakistan but failed. Can you help me in this regard.

01-10-2011, 07:47 PM

As I have mentioned the channels are old and just there to populate the database.

When you add a channel make sure the url you supply is the correct one for the type (ie: make sure it is actually a windows media player stream etc) as windows media player cannot play flash player and flash player cannot play windows media player.


05-14-2011, 12:14 PM
Dear Sir,
I have insert to my sql new category, Then it shows error massage as
Warning: Invalid argument supplied for foreach() in /home/xneedsin/public_html/serverA.php on line 22

please help me to solve this

12-07-2011, 12:51 PM
Most of the live tv channels use flash server and use following

<script type='text/javascript'>id='ti77'; width='550'; height='410';</script><script type='text/javascript' src='http://liveview365.tv/js/player.js'></script>

could u plese help with building swfobject.js and player.js

12-07-2011, 12:53 PM
Most of the live tv channels use flash media server
they use
<script type='text/javascript'>id='ti77'; width='550'; height='410';</script><script type='text/javascript' src='http://liveview365.tv/js/player.js'></script>

could u plese help with building swfobject and player.js

01-29-2012, 05:07 PM
The flash player functions are part of the script, if you want a self contained ie one you can use in other scripts then you will either have to do it on your own or wait for me to decide if i want to add that functionality.