有人可以帮我结合这两个迭代,让两个数组项都显示在我的网页上吗?我要做的是在我的网页中显示 videoURL 和相应的 GroupName。
第一的:
try
{
$sql = 'SELECT URL from videoclip';
$result = $pdo->query($sql);
}
catch (PDOException $e)
{
$error ='Error fetching videos:'.$e->getMessage();
include'error.html.php';
exit();
}
while ($row = $result->fetch())
{
$URLS[] = $row['URL'];
}
include 'index.html.php';
第二:
try
{
$sql = 'SELECT GroupName from videoclip';
$result = $pdo->query($sql);
}
catch(PDOException $e)
{
$error ='unable to fecth data:'.$e->getMessage();
include'error.html.php';
exit();
}
while ($row = $result->fetch())
{
$GroupNames[] = $row['GroupName'];
}
include 'index.html.php';