Start learning with our library of video tutorials taught by experts. Get started
Viewers: in countries Watching now:
Join author David Gassner as he describes how to add dynamic data to a PHP-enabled web site in Adobe Dreamweaver. This intermediate course shows how to plan and create a MySQL database, define a PHP-enabled site in Dreamweaver, connect the site to the database, and manage and present dynamic data. David also explores Dreamweaver features such as PHP custom class introspection and site-specific code hinting as well as the differences between the CS5 and CS6 versions of the software.
This course was updated on 6/12/2012.
Once you've placed a recordset in a PHP page, it's very simple to display the total number of records in the recordset in your PHP output. I'll demonstrate this with the file explorerlist3.php in the explorers folder of the web site. I'll place the cursor before the words "Current Explorers," in the heading above the dynamic table. And I'll type in the words "There are," and I'll delete the word "Current." I am going to add a dynamic value, known as a server behavior.
A server behavior is a bit of generated PHP code that in many cases is using data from a recordset. I'll go to the Server Behaviors panel. If you don't have this Server Behaviors panel in your workspace, you can open it by going to Window > Server Behaviors, or pressing the associated keyboard shortcut. In the Server Behaviors panel, I'll click the Plus button, and I'll choose Display Record Count > Display Total Records. Then I'll click OK.
That adds in a dynamic expression, the recordset TotalRecords property. I'll look at the resulting value in Code View. Here's what it looks like. We're referring to a variable that's set during the initial declaration of the recordset, totalRows_rsExplorers. I'll go to the section of the page that's declaring the recordset, and show you where that variable is being declared, totalRows_rsExplorers = mysql_num_rows, and then the recordset is passed in.
I'll save the change and look at the page in Live View, copying it to the server. I'll look at it in Design View, and there is the result. There are three Explorers in the database table. You can place the output of the total number of records anywhere on the PHP page, as long as it's after the code that retrieves the data from the server and sets that PHP variable, and Dreamweaver will help you insert the code very easily.
Find answers to the most frequently asked questions about Dreamweaver with PHP and MySQL.
Here are the FAQs that matched your search "":
<?php include('../ZendFramework/library/Zend/Date.php'); ?
<?php echo $_SERVER['DOCUMENT_ROOT']; ?
You can then programmatically modify the include_path variable at runtime with the set_include_path() function. For example, if your physical root folder is /home/myroot, the code might look like this:
<?phpset_include_path('.' . PATH_SEPARATOR .'/home/myroot/ZendFramework/library/Zend');include('Date.php');?
Sorry, there are no matches for your search ""—to search again, type in another word or phrase and click search.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.