Skip to main content
Participating Frequently
March 15, 2011
Question

DreamWeaver CS4-CS5 Creates Syntax Errors

  • March 15, 2011
  • 1 reply
  • 1082 views

I cannot seem to find any info on this online but my DreamWeaver CS4 and a trial of DreamWeaver CS5 both create PHP and SQL queries that are loaded with syntax errors. I use XAMPP on my computer as I have done for years, and it works fine with phpMyAdmin and Komodo Edit. DreamWeaver has been a nifty app to quickly knock out simple applications in that past, but now I spend too much time manually correcting syntax errors in PHP page queries.

Has anyone there heard of a fix for this? Several other web developers have told me that they entirely abandoned DW CS* series and moved on to other IDE's rather than try to fix the problem.

EXAMPLE:


Here is what it wrote:

if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
  $updateSQL = sprintf("UPDATE `mysite` SET about-yn=%s, about-h1=%s, about-p1=%s, about-p2=%s, about-p2-img=%s, about-p3=%s, about-p3-img=%s, about-p4=%s, about-p4-img=%s WHERE siteID=%s",
                       GetSQLValueString($_POST['aboutyn'], "text"),
                       GetSQLValueString($_POST['abouth1'], "text"),
                       GetSQLValueString($_POST['aboutp1'], "text"),
                       GetSQLValueString($_POST['aboutp2'], "text"),
                       GetSQLValueString($_POST['aboutp2img'], "int"),
                       GetSQLValueString($_POST['aboutp3'], "text"),
                       GetSQLValueString($_POST['aboutp3img'], "int"),
                       GetSQLValueString($_POST['aboutp4'], "text"),
                       GetSQLValueString($_POST['aboutp4img'], "int"),
                       GetSQLValueString($_POST['siteID'], "int"));

Here is what it should have written:

f ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
   $updateSQL = sprintf("UPDATE `mysite` SET  `about-yn`=\"%s\", `about-h1`=\"%s\", `about-p1`=\"%s\", `about-p2`=\"%s\", `about-p2-img`=\"%s\",  `about-p3`=\"%s\", `about-p3-img`=\"%s\", `about-p4`=\"%s\", `about-p4-img`=\"%s\" WHERE  `siteID`=\"%s\"",
                        GetSQLValueString($_POST['aboutyn'], "text"),
                        GetSQLValueString($_POST['abouth1'], "text"),
                        GetSQLValueString($_POST['aboutp1'], "text"),
                        GetSQLValueString($_POST['aboutp2'], "text"),
                        GetSQLValueString($_POST['aboutp2img'], "int"),
                        GetSQLValueString($_POST['aboutp3'], "text"),
                        GetSQLValueString($_POST['aboutp3img'], "int"),
                        GetSQLValueString($_POST['aboutp4'], "text"),
                        GetSQLValueString($_POST['aboutp4img'], "int"),
                        GetSQLValueString($_POST['siteID'], "int"));

najrellim@gmail.com

This topic has been closed for replies.

1 reply

Günter_Schenk
Inspiring
March 15, 2011

Dreamweaver will not produce such a mess when using column names which comply with the MySQL Naming Conventions and don´t contain (often quite problematic) hyphen characters.

That said, you´ll be on the safe side when renaming your columns by using underscores instead, example:

about_p3_img

Several other web developers have told me that they entirely abandoned DW CS* series and moved on to other IDE's rather than try to fix the problem.

Dreamweaver is certainly not a "perfect" PHP development IDE, but other IDEs (I use Komodo or Aptana at times and like them a lot...) aren´t perfect either. This may seem strange, but IMO Dreamweaver did do the - sort of - right thing by not letting the user get away with using such problematic characters, and that´s what those other IDEs I work with regretfully don´t pay attention to.

JugdishAuthor
Participating Frequently
March 20, 2011

Hi Gunther,

I just wanted to thank you very much for the tip on proper MySQL naming

conventions. That solved my issue.

Please let me know if you have a blog that I can follow via RSS.

Very Truly Yours,

Jan Miller

Günter_Schenk
Inspiring
March 20, 2011

No Problem at all for me to translate them, Gunther, if you could provide a

link to them !

And thank you.


Jugdish wrote:

No Problem at all for me to translate them, Gunther, if you could provide a 

link to them !

Wow, if you manage to get all my verbose stuff translated, you´ll be a true hero !

Here´s one which is titled Dreamweavers Navigationsleiste für Datensatzgruppen and - in a nutshell - demonstrates how to modify the default PHP Recordset Navigation code in order to automatically generate user-definable "Friendly URLs" while navigating the pages.

Have fun !