Dreamweaver MX and PHP Recordsets explained

In this tutorial, we delve under the covers of Dreamweaver MX, and look at how the PHP Recordsets actually work.

Many times in the Macromedia Dreamweaver MX forums there are questions on how to connect to a MySQL database, and how to work with Recordsets, so we're going to look at them in depth and explain how to use values from a recordset in your own code.

Knowing how the Dreamweaver MX generated code works is the first step to hand coding, and allows you to break down the constraints imposed by the Server Behaviors, and create more complex functionality for your websites.

$2.89
- OR -

Overview

Table of Content:

  • The Dreamweaver MX Database Connection
  • How Dreamweaver MX Connects to a MySQL Database
  • What can go wrong with the MySQL Database Connection?
    • Error – 401 or 403 – Unauthorized or Forbidden
    • Error – 404 Page not Found or an Unidentified Error has Occurred
    • Error: 530 An FTP Error occurred – Cannot Make Connection to Host - Login Incorrect
    • Error – 1045 Access denied for user: user@localhost (Using password: YES)
  • General Database Connection Troubleshooting
  • The Dreamweaver MX Connections Folder
  • The Connection File
  • The Connections File in Use
  • Working with Recordsets
  • An Example Recordset
    • Initializing the SQL parameters
    • Querying the Database
  • Using Recordset Variables in your own Code
    • Opening a Recordset based on a value from another Recordset
    • Hiding a Field if it’s Empty
    • Formatting a Recordset Field
    • Displaying the first X characters of a Database Field
    • Displaying the number of Records in a Recordset
  • Summary

 

 

Gareth Downes-Powell

Gareth Downes-PowellGareth has a range of skills, covering many computer and internet related subjects. He is proficient in many different languages including ASP and PHP, and is responsible for the setup and maintenance of both Windows and Linux servers on a daily basis.


In his daily web development work he uses the complete range of Macromedia software, including Dreamweaver MX, Flash MX, Fireworks MX and Director to build a number of websites and applications. Gareth has a close relationship with Macromedia, and as a member of Team Macromedia Dreamweaver, he has worked closely in the development of Dreamweaver, and was a beta tester for Dreamweaver MX.


On a daily basis he provides support for users in the Macromedia forums, answering questions and providing help on a range of different web related subjects. He has also written a number of free and commercial extensions for Dreamweaver MX, to further extend its capabilities using its native JavaScript API’s or C++.


As a web host, Gareth has worked with a range of different servers and operating systems, with the Linux OS as his personal favourite. Most of his development work is done using a combination of Linux, Apache and MySQL and he has written extensively about setting up this type of system, and also running Apache and MySQL under Windows.

See All Postings From Gareth Downes-Powell >>

Reviews

Here's ANOTHER Reason for a 403 Error...

December 17, 2003 by Jeremy Butler
As I just learned, there's ANOTHER reason (other than password protection) that can cause a 403 Forbidden error message: the FTP server, VSFTPD. By default, VSFTPD sets directory and folder permissions to drwx------ instead of the standard drwxr-xr-x This causes Dreamweaver to get all confused when it tries to read the PHP files it's FTPed to the server. Took me HOURS to figure this out. Gareth Downes-Powell's article helped because it explained the FTP/PHP file process, but it did not take into consideration the funky FTP server that comes as SuSE's default. To fix VSFTPD, UNcomment this line: local_umask=022 in /etc/vsftpd.conf. At least, that's what worked for me. Regards,

You must me logged in to write a review.