PDA

View Full Version : update.php


fragop363190
05-13-2009, 03:40 AM
Ok if you open update.php you will notice a "!" near WADAxxx recordset.

If you click to open the info box and check what is wrong you will see dreamweaver shows 2 variables Paramid & Paramixxx.

Im using a database where its tables are named like "categories_cat".

The 2 variables i get are "Paramid" and "Paramid_cat". (the _cat is example look code)

By looking code and if im correct there should be no error and it is probably either a bug of Dreamweaver not handling underscores in table correctly either a syntax bug of DataAssist.
But i only have this problem using the recordset of update page so i suppose its DataAssist.

the code that declares the variable

$Paramid_cmp_WADAcompanies_cmp = "-1";
if (isset($_GET['id_cmp'])) {
$Paramid_cmp_WADAcompanies_cmp = (get_magic_quotes_gpc()) ? $_GET['id_cmp'] : addslashes($_GET['id_cmp']);
}

I dont see a 2nd block of code that is why I suppose its a DW problem probably or syntax.

Im using Vista and DWCS4.

P.S. (I don't see currently any problem using it with question mark, it updates correctly i think, will give more info soon)
P.S.2. Same thing happens on Detail.php page.

Ray Borduin
05-13-2009, 07:49 AM
What version of dataassist are you using? Please post a support incident and include a copy of the page where you are having problems. That will allow webassist engineers to look at the code and try to debug the cause.

fragop363190
05-13-2009, 08:35 AM
DataAssist 2.0.4 latest version.

Ok opening up support ticket.

fragop363190
05-16-2009, 05:19 AM
Ok this has to do with both update.php and detail.php pages and found exact problem and solution. DataAssist generates wrong code IF the table that you are pulling data has a SUFFIX (e.g. datatable_suf)

The WADAtablename recordsets created instead of puting aparameter $Paramid_WADAtablename it writes it as $Piramid_sufix_WADAtablename.

It does the same to the $Paramid2 variable and it transforms it as $Paramid_sufix2_WADAtablename while it should be written as $Paramid2_WADAtablename

Lastly it does it on the Detail.php page at the session variable

$ParamSessionid_suffix_WADAtablename instead of $ParamSessionid_WADAtablename.

This mixes up Dreamweaver (Im using CS4) and ends up the 2 recordsets with a ! mark cause dreamweaver reads the code for some reason as 2 variables and in case we got Piramid1 and 2 then it sees 4 parameters (if you double clikc in recordset/advanced parameters box)

So its partial a DataAssist "Minor" bug cause it writes wrong code for piramid parameter
and its partial for Dreamweaver i suppose but im not sure since i dont know how dreamweaver reads exactly the blocks so i can't be sure about that.

Give me an answer if I should report this as a bug and open ticket or you will address it to your tach team so it is fixed in the next 2.0.5 release of DataAssist.

You can resolve the issue by renaming the parameters as shown above.


WARNING: This bug is only presented when you got a SUFFIX at your tables. e.g. im always using suffixes for my own reasons and writing the tables as companies_cmp.

the cmp is called a suffix for the new developers out there.

Hope this post helped.

Willi Schneider
09-16-2009, 01:38 AM
Hi Fragop

I've got the same issue on CS3. Do you have _underscores in your columns, too?
Or does this just occur when you have your tablenames with suffixes?

WA-team, will there be a fix soon?

Edit:
I'ver just created a new database table "tblVereine" with 12 columns like "IDVer", "nameVer". Then I applied the WA_DataAssist Wizard (2.05) and get the same errors in the update, insert and delete page.

Please WA see, if you can fix this soon.

Ray Borduin
09-16-2009, 07:26 AM
There is an issue with DW not recognizing parameters with two underscores. We will address this in the next dot release, but you need to manually rename the parameters by hand.

The second post seems to be another bug, but I'm not sure what it is. What is the exact error you are getting? What does the generated code look like? If we are able to reproduce and understand that problem we will be able to fix it as well.

Willi Schneider
09-16-2009, 07:50 AM
Hi Ray

Thanks for your reply.

The problem in my second post happens, when I try to update an entry. Leaving some of the form fields empty, because I might not have the information, produces a MySQL error. I've attached a screenshot demonstrating the issue.

Ray Borduin
09-16-2009, 11:18 AM
Unfortunately the screen shot is too small to see the contents of the error. What exactly does the error say?

Willi Schneider
09-17-2009, 07:24 AM
Hi Ray

The error message is as follows:

<quote>
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 ' `ansprechVer` = 0 WHERE `IDVer`=112' at line 1
</quote>

This is telling me, that this form field needs to submit some content. But the table column "ansprechVer" can be empty "null" due to my table definition.

Ray Borduin
09-17-2009, 07:55 AM
I will open a support incident so that somebody can look into this with you further.

Please go to the support history section of the webassist web site and update the incident with your phone number so that somebody will be able to contact you directly.

Willi Schneider
09-18-2009, 09:19 AM
Hallo Ray

Thank you very much for the great support. The issue was solved.

FYI: The reason was that the data type of two table columns was not detected correctly. Running the update/insert server behavior and setting the correct data type in step two of the wizard, fixed the issue.

P.S.: I think, switching to the subscription of the extension library turns out to be the right decision.

jcottone345328
01-05-2010, 01:01 PM
I'm using 2.0.6 and had a similar issue. I actually found out that the update server behavior didn't link the primary id properly. So I edited the update behavior from WA pre programmed behavior and made sure the primary id was linked to the hidden field. Now it updates just fine :)