In general, friends ... I can not see an error in the code ... There is a code below that inserts the id, name, series fields into the database, but the name is always the same. The output works, but it inserts not ... Where is the cant with brackets ...
$sqlGetContentId = mysql_query("SELECT episode.id, episode.parent_id FROM parser.episode GROUP BY parent_id limit 10"); $sql = mysql_query("SELECT content.id, name, description, screenshot.url, episode.smil, content_types.type_id FROM parser.content, parser.screenshot, parser.episode, parser.content_types WHERE screenshot.id = content.id AND screenshot.size = '768x432' AND content.id = episode.id AND content_types.content_id = content.id LIMIT 10"); while ($row = mysql_fetch_assoc($sql)) { echo $id = $row['id']; echo "<br>"; echo $name = $row['name'] . "\n"; echo "<br>"; echo $description = $row['description'] . "\n"; echo "<br>"; echo $url = $row['url'] . "\n"; echo "<br>"; echo $smilSelect = $row['smil'] . "\n"; echo "<br>"; echo $typesId = $row['type_id'] . "\n"; echo "<br>"; } if ($sql == true) { if ($sqlGetContentId == true) { while ($row = mysql_fetch_assoc($sqlGetContentId)) { $newId = $row['id']; $contentId = $row['parent_id']; $sqlGetCount = mysql_query("SELECT count(episode_num) AS counterContent FROM parser.episode WHERE parent_id = $contentId"); if ($sqlGetCount == true) { $row = mysql_fetch_row($sqlGetCount); if ($row[0] > 1) { $number = $row[0]; $arr = range(1, $row[0]); echo $str = serialize($arr); $string = $str; echo "<br>"; $inertFilm = mysql_query("INSERT INTO stalker_db.news (id, name, series) VALUES ('$newId', '$name', '$str')"); } if ($row[0] == 1) { $urlFilm = "http://main.itv.by/getsmil.php?season=0&episode=0&content=$id"; $inertFilm = mysql_query("INSERT INTO stalker_db.news (id, name, series) VALUES ('$id', '$name', '$str')"); echo "This is film: " . "\n"; echo "<br>"; } } } }
}