New Recordset from Recordset
Hello,
I created a recordset from another recordsets ID. Maybe there is a nice way to do this.
<?php
$colname_band = "-1";
if (isset($_GET['urlName'])) {
$colname_band = $_GET['urlName'];
}
mysql_select_db($database_Localhero, $Localhero);
$query_band = sprintf("SELECT * FROM artists WHERE urlName = %s LIMIT 1", GetSQLValueString($colname_band, "text"));
$band = mysql_query($query_band, $Localhero) or die(mysql_error());
$row_band = mysql_fetch_assoc($band);
$totalRows_band = mysql_num_rows($band);
?>
<?php
$bandID = $row_band['id'];
?>
<?php
mysql_select_db($database_Localhero, $Localhero);
$query_news = "SELECT * FROM news WHERE news.artistID = $bandID";
$news = mysql_query($query_news, $Localhero) or die(mysql_error());
$row_news = mysql_fetch_assoc($news);
$totalRows_news = mysql_num_rows($news);
?>
When I try to use $row_band['id'] directly in the DW query wizard I get an error.
Any suggestion to do this nicer?
Cheers,
Denis