Beispiel #1
0
function sql_addChannel($myc, $s)
{
    global $debug;
    $tblname = 'channels';
    //
    // prvo insert novog channela (name je unique)...
    //
    $q = "INSERT INTO " . $tblname . " SET id='" . $s['id'] . "'";
    if ($debug) {
        dbg("INSERT INTO", $q);
    }
    if (!mysql_query($q, $myc)) {
        print "<h4>MySQL: Can't add channel " . $s['id'] . " to " . $tblname . "</h4>\n";
        print mysql_error($myc) . "\n";
        return false;
    }
    print "<pre>MySQL: Channel " . $s['id'] . " added</pre>\n";
    //
    // nakon inserta azuriranje podataka...
    //
    sql_updateChannel($myc, $s);
    return true;
}
Beispiel #2
0
         print "</script>\n";
         break;
     }
     switch ($dconf['dbtype']) {
         case 'mysql':
             sql_addChannel($myc, $channelpost);
             break;
     }
     print "<h1>Channel " . $channelpost['id'] . " added</h1>\n";
     reloadUrl('Continue', 'channelslist.php');
     addlog(true, "Channel " . $channelpost['id'] . " added");
     break;
 case 'update':
     switch ($dconf['dbtype']) {
         case 'mysql':
             sql_updateChannel($myc, $channelpost);
             break;
     }
     print "<h1>Channel " . $channelpost['id'] . " updated</h1>\n";
     reloadUrl('Continue', 'channelslist.php');
     addlog(true, "Channel " . $channelpost['id'] . " updated");
     break;
 case 'delete':
     switch ($dconf['dbtype']) {
         case 'mysql':
             sql_deleteChannel($myc, $channelpost);
             break;
     }
     print "<h1>Channel " . $channelpost['id'] . " deleted</h1>\n";
     reloadUrl('Continue', 'channelslist.php');
     addlog(true, "Channel " . $channelpost['id'] . " deleted");