close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Datassist - Spaces in database field name

Thread began 3/21/2011 10:24 am by david.cunningham54385851 | Last modified 3/22/2011 11:40 am by Jason Byrnes | 956 views | 3 replies |

david.cunningham54385851

Datassist - Spaces in database field name

Hi all,

I wonder if you could help with a little prob I've been scratching my head over for a couple of days now?

I have inherited a mysql database and been asked to create a web app for it. I used Dataassist to create the "insert, update, search and detail" pages required for my project, but am having issues with the update and insert pages where fields exist with spaces...

Bear with me...

I am aware of using ` with database fields and have used this on other sections of the project with no problem. The issue appears to be on the following line;

$WA_fieldNamesStr = "Title|First Name|Surname|Position|Company|Address 1|Address 2|Town|County|Postcode|Telephone Day|Telephone Evening|Fax|E-mail|Date Registered";

I tried this with asp and mssql and found that the same issue occured unless I set the following;

$WA_fieldNamesStr = "Title|[First Name]|Surname|Position|Company|[Address 1]|[Address 2]|Town|County|Postcode|[Telephone Day]|[Telephone Evening]|Fax|[E-mail]|[Date Registered]";

...yet when I try this in php with mysql (using `) it always fails.

Anybody have any ideas? Unfortunately we can't go asp and we have an access frontend hanging off the DB, so I can't change the field names either.

Any help greatfully received.

Dave

Sign in to reply to this post

Jason ByrnesWebAssist

are you sure you are using the "`" character and not the apostrophe "'":
$WA_fieldNamesStr = "Title|`First Name`|Surname|Position|Company|`Address 1`|`Address 2`|Town|County|Postcode|`Telephone Day`|`Telephone Evening`|Fax|`E-mail`|`Date Registered`";

Sign in to reply to this post

david.cunningham54385851

I can confirm that I am using the ` character. When I add it to the `First Name` section of the line above and try an insert I get the following;

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'First Name``,`Surname`,`Position`,`Company`,`Address 1`,`Address 2`,`Town`,`Count' at line 1

Regards

Dave

Sign in to reply to this post

Jason ByrnesWebAssist

what version of DataAssist are you using?

In version 2.0.8, the insert and update behavior will automatically enclose all columns using the ` character to avoid problems with column names like this.


if you dont edit the code, are you getting an error message?

one thing to double check is your form element names.

they will be named for for the column,so the first name form element will be named "first name":

<input type="text" name="first name" id="first name" value="" size="32" />


spaces are not valid in form element names, so this will need to be changed to:
<input type="text" name="firstname" id="firstname" value="" size="32" />


after renaming all the form elements with spaces in them, you will need to edit the insert and update behaviors to rebind the columns to the correct form elements.

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

Content

rating

Layout

rating

Ease of use

rating

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