close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

No entry in database

Thread began 12/29/2009 1:43 pm by i.edwards384429 | Last modified 1/05/2010 3:40 pm by Jimmy Wu | 1265 views | 4 replies |

i.edwards384429

No entry in database

Hi

using the user solution and lots of help I've sort of got it all working.

Just worked through the adding a digital file pro to the insert pages and to my surprise it worked but ( ok there's always a but) I discovered that although the files are being uploaded to the correct directories the database is not being updated.

Would appreciate a hint as to how to start trouble shooting

thanks

Ian

Sign in to reply to this post

Jimmy Wu

Digital file pro upload does not insert into the database automatically. You will have to insert the information into the database after the upload. You can get the relevant information from the upload in the bindings panel.

Sign in to reply to this post

i.edwards384429

update

Hi

IN the Server behaviours panel I do have Insert record (users)

with the code in the head as below.

I thought this was the code that added the entries to the database?

Is this not so?

thanks

Ian

<?php
// WA Application Builder Insert
if ($_SERVER["REQUEST_METHOD"] == "POST") // Trigger
{
$WA_connection = $localhost;
$WA_table = "users";
$WA_sessionName = "users_UserID";
$WA_redirectURL = "";
$WA_keepQueryString = false;
$WA_indexField = "UserID";
$WA_fieldNamesStr = "UserImage1|UserImage2|UserImage3|UserImage4|UserImage5";
$WA_fieldValuesStr = "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."" . "|" . "".$WA_DFP_UploadStatus["WA_UploadResult2"]["serverFileName"] ."" . "|" . "".$WA_DFP_UploadStatus["WA_UploadResult3"]["serverFileName"] ."" . "|" . "".$WA_DFP_UploadStatus["WA_UploadResult4"]["serverFileName"] ."" . "|" . "".$WA_DFP_UploadStatus["WA_UploadResult5"]["serverFileName"] ."";
$WA_columnTypesStr = "',none,''|',none,''|',none,''|',none,''|',none,''";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_localhost;
mysql_select_db($WA_connectionDB, $WA_connection);
if (!session_id()) session_start();
$insertParamsObj = WA_AB_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
$WA_Sql = "INSERT INTO `" . $WA_table . "` (" . $insertParamsObj->WA_tableValues . ") VALUES (" . $insertParamsObj->WA_dbValues . ")";
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
$_SESSION[$WA_sessionName] = mysql_insert_id();
if ($WA_redirectURL != "") {
if ($WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
$WA_redirectURL .= ((strpos($WA_redirectURL, '?') === false)?"?":"&").$_SERVER["QUERY_STRING"];
}
header("Location: ".$WA_redirectURL);
}
}
?>

Sign in to reply to this post

i.edwards384429

update

Hi

been through the tutorial again and have been working with just the insert page located at

users_Insert.php

(I haven't restricted any access yet - I add the link for code view purposes)

If I go to

users_LogIn.php

and log in I've set this up to go to the users_Insert.php page.

( used data assist wizard on the users table)

On the users_Insert.php page I've added five upload fields which work and upload images perfectly.

I then followed the instructions to add the insert record behavior using the dataAssist isert record behaviour.

That added the code below:

<?php
// WA Application Builder Insert
if ($_SERVER["REQUEST_METHOD"] == "POST") // Trigger
{
$WA_connection = $localhost;
$WA_table = "users";
$WA_sessionName = "users_UserID";
$WA_redirectURL = "";
$WA_keepQueryString = false;
$WA_indexField = "UserID";
$WA_fieldNamesStr = "UserImage1";
$WA_fieldValuesStr = "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."";
$WA_columnTypesStr = "',none,''";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_localhost;
mysql_select_db($WA_connectionDB, $WA_connection);
if (!session_id()) session_start();
$insertParamsObj = WA_AB_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
$WA_Sql = "INSERT INTO `" . $WA_table . "` (" . $insertParamsObj->WA_tableValues . ") VALUES (" . $insertParamsObj->WA_dbValues . ")";
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
$_SESSION[$WA_sessionName] = mysql_insert_id();
if ($WA_redirectURL != "") {
if ($WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
$WA_redirectURL .= ((strpos($WA_redirectURL, '?') === false)?"?":"&").$_SERVER["QUERY_STRING"];
}
header("Location: ".$WA_redirectURL);
}
}


When I upload however no entry is made in the database

Any ideas?

thanks

Ian

Sign in to reply to this post

Jimmy Wu

Have you tried testing the database insert behavior on a regular form? It could be that the insert behavior is not being added correctly to insert into your database.

So create a blank page and try creating a form and applying the insert server behavior to insert the form elements into a database table and see if that works.

Is the form action set to POST or is it set to another value?

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