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

rating

update via admin page

Thread began 4/19/2011 10:07 am by i.edwards384429 | Last modified 4/20/2011 9:44 am by Jason Byrnes | 1926 views | 11 replies |

i.edwards384429

update via admin page

Hi

added a field called " paid" into the database varchar.

If I used phpmyadmin and type in the field "yes" then when I open Users_detail.php then the vsalue is echo'd to the form.

If I open users_update.php the value is again echo'd to the form.

If I delete the "yes" from the database using phpmy admin and then go to users_update.php type in yes and then select update the database table is not updated.

can't see why would appreciate someone looking at the code and teling what I've missed

thanks
Ian

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

Jason ByrnesWebAssist

the code looks correct. to trouble shoot, change:

php:
$WA_redirectURL = "users_Detail.php?UserID=".((isset($_POST["WADAUpdateRecordID"]))?$_POST["WADAUpdateRecordID"]:"")  ."";



to:

php:
//$WA_redirectURL = "users_Detail.php?UserID=".((isset($_POST["WADAUpdateRecordID"]))?$_POST["WADAUpdateRecordID"]:"")  ."";

$WA_redirectURL = "";



then add the following code after the <body> tag to write the sql statement being used to the page:

php:
<?php echo("SQL: ".$WA_Sql."<br />"); ?>



post back the sql after testing

Sign in to reply to this post

i.edwards384429

update

Hi Jason

the sql is

Notice: Undefined variable: WA_Sql in C:\wamp\www\1stmodelagency\Admin\users_Update.php on line 168

line 168 is theline you toldme to add so I'm clearly not looking in the correct place

thanks

Ian

Sign in to reply to this post

Jason ByrnesWebAssist

try using this code instead:

php:
<?php

if (isset($_POST["Update_x"])){
echo(
"SQL: ".$WA_Sql."<br />");
}
?>
Sign in to reply to this post

i.edwards384429

update

Hi Jason

I substituted "<?php echo("SQL: ".$WA_Sql."<br />"); ?> " ( which I had placed after the opening body tag with "<?php
if (isset($_POST["Update_x"])){
echo("SQL: ".$WA_Sql."<br />");
}
?> "

Now when I try to update I see no error message whatsoever and the table is still not updated

cheers

Ian

Sign in to reply to this post

Jason ByrnesWebAssist

ok, sounds like the validation then.


change :

php:
if ($WAFV_Errors != "")  {

    PostResult($WAFV_Redirect,$WAFV_Errors,"usersUpdate");
  }




to:

php:
if ($WAFV_Errors != "")  {

    die($WAFV_Errors);
    PostResult($WAFV_Redirect,$WAFV_Errors,"usersUpdate");
  }




and post the results after testing.

Sign in to reply to this post

i.edwards384429

update

I say that did something ;-)

I've glad you understand it!!

cheers

Ian


Deprecated: Function split() is deprecated in C:\wamp\www\1stmodelagency\WA_ValidationToolkit\WAVT_Scripts_PHP.php on line 330

Deprecated: Function eregi() is deprecated in C:\wamp\www\1stmodelagency\WA_ValidationToolkit\WAVT_Scripts_PHP.php on line 547

Deprecated: Function eregi() is deprecated in C:\wamp\www\1stmodelagency\WA_ValidationToolkit\WAVT_Scripts_PHP.php on line 547
,8,12,13,14

Sign in to reply to this post

Jason ByrnesWebAssist

in the WAVT_Scripts_PHP.php search for:
split(

and change it to:
explode(


it should be found on lines 330 and 547

The string of numbers at the end:
,8,12,13,14

Means that validation for the UserPhone, UserState, UserZip and UserCountry are failing.

make sure those elements are properly filled in.

Sign in to reply to this post

i.edwards384429

update

Hi Jason

Did some investigating and decided to create a new user registration and if it worked compare files etc.

I downloaded a new copy of the user registrstion and did virgin install to a new database.

I used the users simple registration and it accepted and wrote to the database.

I then logged into the users_Profile.php

added some details inc phone mumber went and wrote to the users table.

I exited and loaded admin\users_Update.php

searched for user

and then pressedthe pen icon to edit the user

changed the country and the city

pressed update

It tells me straight away to "Please Enter a phone number" despite one being there although it is the same format as in the user profile page and the same number.

if i type in 12345678912 I get the same message, if I continue to type in letters then I get told I have exceeed the maximum number of characters.

I can't get past this so it's stopping the update process.

Not sure if this was my initial issue but....

cheers

Ian

Sign in to reply to this post

i.edwards384429

update

Hi Jason

got the form updateing - thanks fo rthe help.

I now need to add two additional form fields to update the database.

The two database fields are:

date_paid

paid

I added two rows to the table and place a text field in the appropriate colum.

in the initial value I selected the lightning bolt to fill with the value from the database.

However in the record set that opens I do not see my two additional fields in the record set wadausers.

If I double click on the record set and then select "test" the two colums date_paid and paid are shown.

what am I missing or am I approaching this the wrong way?

thanks

Ian

Sign in to reply to this post
loading

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