close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Problem inserting record....no errors given

Thread began 11/24/2009 9:48 pm by jc1cell390254 | Last modified 12/01/2009 12:50 pm by Jason Byrnes | 1321 views | 8 replies |

jc1cell390254

Problem inserting record....no errors given

So I'm back with the same problem I originally had, except this time everything seems to run great but no record is being inserted from my form. While troubleshooting I noticed that the DW insert behavior doesn't give me the red exclamation but the DA behavior does.

Here's how everything is set up. I have the register form working great. The client record is created taking me to the login page. This also works great. It takes me to the client base page (not developed yet, just a placeholder). I don't have a link to the project form page, so after going through the motions above I view it in my browser and fill it in. When I hit submit, it seems like it thinks for a second and then stays on the same page. No new record, no redirection to client base page. Nothing.

I have included the .zip files of all the mentioned pages in hopes that you may be able to see my problem.

Oh. I should mention that in the project form I have a hidden field created. This field received data from a recordset I created that gets the client id if the email in the cookies is equal to the email in the client table.

Before I used to get an error saying that the client Id is missing and it couldn't create the child record. But now I get nothing. If you also need a copy of the database I can provide that as well.

This step seems to be my aquiles heel since every time I get to it I'm stumped. I've read some php tutorials and seem to understand it fairly well. But I'm afraid not well enough to get this figured out. I even tried the echo command and it didn't work for me....like I said, I understand it but can't implement yet.

Please...Ayuda!!! :D

jc

Attached Files
website structure template.zip
Sign in to reply to this post

Jason ByrnesWebAssist

The problem is in the way you have created the colname parameter of the rs_idClient recordset.

thwe code looks like this:

php:
$colname_rs_idClient = "-1";

if (isset($_COOKIE[''])) {
  $colname_rs_idClient = (get_magic_quotes_gpc()) ? $_COOKIE[''] : addslashes($_COOKIE['']);
}





there is no specific cookie selected for the value of the parmeter, so the recordset is empty.


If you where to change the HiddenFields_ClientEmail hidden form element to a text field, you would see that it is empty since the it gets a value from the recordset.

There are 2 options:
1 the easy way) Edit the login page. Double click the Security Assist Authenticate user server behavior. On the third page, you can select columns to store in a session variable when the user logs in. Select the email column so the email address is stored in a session variable when the user logs in.

This way ,you dont need to create a recordset to look it up. you can use the session variable as the initial value instead.

your login page has two instances of the authenticate user server behavior, so make sure to change both.


2, the slight more difficult way) The login page creates a session variable named "IDclient", use this to filter the recordset instead of the cookie.

Sign in to reply to this post

jc1cell390254

That was great Jason,

I obviously did the first one although as you said, all I needed to modify in my rs was the cookie being used. Your first solution was what I originally wanted to do but couldn't figure out how to do it.

I've been listening to some Lynda.com php tutorials to help me out and also dynamic sites with dreamweaver. It actually helped me understand what you're saying better and also understand the WA extensions better.

Hopefully I'll be able to figure things out on my own a bit more....but don't hold me to that. I'm sure I'll be back!!!

Thanks again.

jc

Sign in to reply to this post

Office Guy-172461

It's a holiday weekend here in the US, but I wanted to thank you for such a positive attitude and taking the time to post back your results. It's refreshing to see someone look at the learning stage as an adventure instead of complaining about how hard it is. :)

Thanks as well for setting your location. I wish more would do that, as it helps to know when there are time zone differences and other possible differences in the way we look at things. It's also fun to see all the different place people come from. :)

Sign in to reply to this post

jc1cell390254

You're quite welcome Office Guy!!!

From previous posts I'm sure you gathered some of my frustration. But if I've learned anything as I get closer to middle age ( but a teen at heart :p ) is that complaining constantly about something is fruitless, while taking action is fruitful. Plus the fact that I have two teens that suffer from complainitis (and a wife, to be quite honest) so my way of thinking is reinforced daily :D.

I voice my complaints more as an opinion and move on from there to find a solution. And once the solution is found.....BAM!!! The excitement begins. Although I must admit that I have been guilty of complainitis at times as well :mad:.

By the way. Hope your thanksgiving weekend was as GREAT as mine. Gobble, gobble...:rolleyes:

Cheers
jc

Sign in to reply to this post

jc1cell390254

So embarrassed to be here for this again...

So I finally finished my final form and it looks great, the dynamic dropdowns work awesome. Now I decide to test the functionality; you know, see if it adds the record. At first it failed and I thought it happened because I didn't log in setting the session Id that's needed to identify the client.

So now I go and start the registration process since I removed the database and replaced with a slightly altered one (this erased all the records in the specific tables). But now the registration form doesn't work. It gives me the same error I was getting originally when I was doing it with FB.

  Cannot add or update a child row: a foreign key constraint fails (`zonapromo/Clients`, CONSTRAINT `fk_Clients_country_t1` FOREIGN KEY (`country_t_country_id`) REFERENCES `country_t` (`country_id`) ON DELETE NO ACTION ON UPDATE NO ACTION)  

I then proceeded to redo the registration form and still no dice. I tested the table by inserting the record via phpmyadmin and that worked. So I figure I can test the projects form with that record. So I log in...that worked great and then I fill in my info for the project... everything looking good, so I send. I get the same problem jason solved for me initially. Si come here and look for the solution he gave and re-apply it (it was still set the way I had it to begin with, but for reassurance, you know?) but that didn't do the trick for me.

So, to summarize, the registration form does not register :confused: (pun intended) and the new project form once again stays in limbo. I'm not sure if all that turkey stuffing filled my brain with dumbitis, but I'm hoping the files I have uploaded will give you some insight on where I'm going wrong. I even included the .sql file I'm using for the database in case it helps.

I know these things can get confused sometimes with changes, but I don't get how a simple changes to the table (All I did was remove the location column in the client table and replaced it with the country Id foreign key) would cause it to stop working like this, I did rebuild it. Hoping you will shed some light on the matter.

jc

Attached Files
files1.zip
Sign in to reply to this post

jc1cell390254

So, looking into the forms a bit more I just realized that what I did with the clients table I need to do with the projects table.

In the client table I had a field for location and at the same time had a foreign key for the country table. If I understand this correctly, having both defeats the purpose of having the country table and therefore the countryid fk in the client table. So that's why I replaced the location field with the country id field.

The same is happening in my project table. I have a project type field as well as a milestone amount field. I have two respective tables for project types and milestone amounts which I use to fill the menu list on the form. I'm thinking about replacing the first two mentioned fields with their respective fk fields.

I think these replacements and the use of the fk are at the root of the problem and am not sure if I'm over-thinking the table layout or I'm simply implementing the form wrong.

jc

Sign in to reply to this post

jc1cell390254

So i must say that the turkey weekend got to me guys. I apologize deeply for any time you may have spent checking this out.

It turns out that I didn't properly set the record insert options in either the registration form or the projects form (i did double check, obviously not well enough). Everything seems to be working now. I did the changes to the table as mentioned above and reapplied the fields to their respective table field and all is working.

Once again, I apologize for any time you may have spent on this. I'm embarrassed once again.

Jose

Sign in to reply to this post

Jason ByrnesWebAssist

OK, glad to hear you have it working.

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