コード例 #1
0
function insertIntoSong($songName, $albumId, $songMusicBy, $songLyricist, $songSinger, $songLyrics)
{
    global $mysqli;
    $result = $mysqli->query("\n                   INSERT INTO  `songs` (\n                      `SongId` ,\n                      `SongName` ,\n                      `AlbumId` ,\n                      `SongMusicBy` ,\n                      `SongLyricist` ,\n                      `SongSinger` ,\n                      `SongLyrics` ,\n                      `TotalVisits` ,\n                      `DateEdited`,\n                      `DateCreated`\n                      )\n                      VALUES (\n                      NULL ,  '" . $songName . "',  '" . $albumId . "',  '" . $songMusicBy . "',  '" . $songLyricist . "',  '" . $songSinger . "',  '" . $songLyrics . "',  '0',CURRENT_TIMESTAMP,\n                      CURRENT_TIMESTAMP\n                      )");
    indexSongToDb(getSongIndex($songName, $albumId, $songLyrics));
    return $albumId;
}
コード例 #2
0
function insertIntoSong($songName, $albumId, $songMusicBy, $songLyricist, $songSinger, $songLyrics)
{
    global $mysqli;
    $result = $mysqli->query("\n                   INSERT INTO  `songs` (\n                      `SongId` ,\n                      `SongName` ,\n                      `AlbumId` ,\n                      `SongMusicBy` ,\n                      `SongLyricist` ,\n                      `SongSinger` ,\n                      `SongLyrics` ,\n                      `TotalVisits` ,\n                      `DateEdited`,\n                      `DateCreated`\n                      )\n                      VALUES (\n                      NULL ,  '" . mysqli_real_escape_string($mysqli, $songName) . "',  '" . mysqli_real_escape_string($mysqli, $albumId) . "',  '" . mysqli_real_escape_string($mysqli, $songMusicBy) . "',  '" . mysqli_real_escape_string($mysqli, $songLyricist) . "',  '" . mysqli_real_escape_string($mysqli, $songSinger) . "',  '" . mysqli_real_escape_string($mysqli, $songLyrics) . "',  '0',CURRENT_TIMESTAMP,\n                      CURRENT_TIMESTAMP\n                      )");
    if ($result) {
        indexSongToDb(getSongIndex($songName, $albumId, $songLyrics));
        return $albumId;
    } else {
        echo mysqli_error($mysqli);
        return mysqli_error($mysqli);
    }
}