Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
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.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 74205 Viewers
80 Video lessons · 129570 Viewers
52 Video lessons · 63852 Viewers
59 Video lessons · 49637 Viewers
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.
Your file was successfully uploaded.