close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

New Recordset from Recordset

Thread began 4/09/2013 5:45 pm by Cologne | Last modified 4/10/2013 10:24 am by Jason Byrnes | 178 views | 2 replies |

Cologne

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

Sign in to reply to this post

Jason ByrnesWebAssist

Use the advanced recordset mode. create the where clause as:
WHERE news.artistID = paramBandID

in the parameters section create a new parameter as:
Name: paramBandID
Type: Integer
Default Value: -1
Run Time Value: $row_band['id']

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...