我在这里有一个查询,从 MySQL 数据库中提取数据。它工作得很好。但是我想做的是将所有从模块表中提取的数据保存到另一个表中。请问我该怎么办?任何帮助,将不胜感激。谢谢。
$coremoduleY1Query = "SELECT ID,title,credits FROM module WHERE ID = 'CS1101'
UNION SELECT ID,title,credits FROM module WHERE ID = 'CS1105'
UNION SELECT ID,title,credits FROM module WHERE ID = 'CS1106'
UNION SELECT ID,title,credits FROM module WHERE ID = 'CS1107'
UNION SELECT ID,title,credits FROM module WHERE ID = 'CS1108'
UNION SELECT ID,title,credits FROM module WHERE ID = 'CS1109'";
$coremoduleY1Result = mysql_query($coremoduleY1Query);
echo "<B> Core Modules </B>";
while ($coremoduleRow = mysql_fetch_array($coremoduleY1Result)) {
$id = htmlentities($coremoduleRow['ID']);
$title = htmlentities($coremoduleRow['title']);
$credits = $coremoduleRow['credits'];
echo "<ul>" . $id . " " . $title . " " . $credits . "</ul>";
}
echo "<br />";