close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues


get rid of "or die(mysql_error())"

Thread began 12/07/2009 11:56 am by barbara224891 | Last modified 12/08/2009 11:35 am by Ray Borduin | 2737 views | 3 replies |


get rid of "or die(mysql_error())"

It's a bad practice to echo all of one's mysql errors to the screen, since it gives away a lot of information about the structure of your database to hackers. I've taken to commenting out this string. This has the unfortunate effect of making it so that DW won't recognize recordsets or behaviors, which makes it hard to work on the page usefully. Any chance you could make an extension that would let DW parse recordsets and behaviors even when the echoing of the mysql errors has been turned off?

Sign in to reply to this post

Justin Nemeth

Rather than making code modifications, I would recommend setting the php setting display_errors to off. This will prevent any messages from being written out to the page. It is recommended to hide error messages on a live production server like you said.

If you have access to the php.ini, you can change the setting there. Otherwise this line of php should also work:

ini_set('display_errors', 'off');


Sign in to reply to this post


I have errors set to off, but when you tell it die(mysql_error), it overrides that.

Sign in to reply to this post

Ray BorduinWebAssist

I'll add that functionality to the next version of DataAssist, so that you can remove the or die(mysql_error) manually. Unfortunatly Dreamweaver will always add it back when you edit the recordset so you may have to remove it repeatedly.

I have attached the "fix" for this issue. Just unzip and place the .edml file in your configuration/server behavoirs/php_mysql/ directory and it should allow you to remove the die statement and still recognize the recordset. If you have dataassist you can replace the file that is already there.

Attached Files
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





Ease of use


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...