close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Data Assist Issue!

Thread began 12/21/2009 9:31 pm by sudeep.pavithran374974 | Last modified 12/23/2009 11:31 pm by sudeep.pavithran374974 | 3546 views | 9 replies |

sudeep.pavithran374974

Data Assist Issue!

Hello there,

I started using DataAssist recently in one of our site, and I used the wizard to create the admin pages. Everything works fine except Update & Insert pages. It gives me an error.

I am not good at PHP coding. Could you please guide me to fix this? Please find the url below.

clients_det_Results.php

Thanks & Regards,
Sudeep K Pavithran

Sign in to reply to this post

CraigRBeta Tester

parse error

you have a php parse error (syntax) on the lines mentioned, can you post the relevant pages so someone can look at them in detail ?

Sign in to reply to this post

Ray BorduinWebAssist

The errors on the page give line numbers, so the problem is on those lines... for instance on the update page I see:

Parse error: syntax error, unexpected ';' in E:\inetpub\vhosts\alshirawifm.com\httpdocs\mod\clients_det_Update.php on line 34

what is on lines 33-35 of that file?

Sign in to reply to this post
Did this help? Tips are appreciated...

sudeep.pavithran374974

PHP code!

Hi..

Thanks a lot for the reply! Here I am pasting few lines from the code..

clients_det_Insert.php -- Error shows in the 9th line.
<?php require_once("Connections/authen.php"); ?>
<?php require_once("WA_DataAssist/WA_AppBuilder_PHP.php"); ?>
<?php
// WA Application Builder Insert
if (isset($_POST["Insert_x"])) // Trigger
{
$WA_connection = $authen;
$WA_table = "clients_det";
$WA_sessionName = "WADA_Insert_clients_det"; --> this is the 9th line
$WA_redirectURL = "clients_det_Detail.php";
$WA_keepQueryString = false;
$WA_indexField = "clientname";
$WA_fieldNamesStr = "";
$WA_fieldValuesStr = ;
$WA_columnTypesStr = "";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_authen;
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);
}
}
?>

-----------------------------------------------------------------------------------------------------

clients_det_Update.php --> Error in the line 34

<?php require_once('Connections/authen.php'); ?>
<?php require_once("WA_DataAssist/WA_AppBuilder_PHP.php"); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
?>
<?php
$Paramclientname_WADAclients_det = "-1"; ---> This is the 34th line
if (isset($_GET['clientname'])) {
$Paramclientname_WADAclients_det = (get_magic_quotes_gpc()) ? $_GET['clientname'] : addslashes($_GET['clientname']);
}
mysql_select_db($database_authen, $authen);
$query_WADAclients_det = sprintf("SELECT clientname FROM clients_det WHERE clientname = %s", GetSQLValueString($Paramclientname_WADAclients_det, "text"));
$WADAclients_det = mysql_query($query_WADAclients_det, $authen) or die(mysql_error());
$row_WADAclients_det = mysql_fetch_assoc($WADAclients_det);
$totalRows_WADAclients_det = mysql_num_rows($WADAclients_det);?>

--------------

Thanks for the support

Sudeep K Pavithran

Sign in to reply to this post

CraigRBeta Tester

could you possibly add the two pages to a zip file and upload it ?

i can then take a proper look.

Regards

Sign in to reply to this post

sudeep.pavithran374974

Insert & Update PHP files

Hi

Please find attached zip file for both insert & update php files.


Many Thanks

Sudeep K Pavithran

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

CraigRBeta Tester

I looked at the insert page, and there is no recordset there.

the following lines...

$WA_fieldNamesStr = "";
$WA_fieldValuesStr = ;
$WA_columnTypesStr = "";

should have code which, when the insert button is pressed, will insert the correct data from the form into the recordset fields.

In Dreamweaver, take a look at the 'insert record' server behavior if it is there, to set these values.

if it isn't there, and you are unfamiliar with php, I recommend you try going through the wizard again

Sign in to reply to this post

sudeep.pavithran374974

Update & Delete issue

Hi Craig,

With your help, I got rid of the errors and "Insert" is working fine now... But record is not getting updated & deleted in their respective pages.

I saw in another thread that the space in the variable value is the problem. As it converts it into %xx.. Please tell me how do I get rid of this..?

Thanks & Regards,
Sudeep K Pavithran

Sign in to reply to this post

CraigRBeta Tester

on the update page, try changing the comparison string to "=" and see if it works.

It may be that you are trying to update the recordset where no criteria are met, so nothing will be updated.

For the delete page, post a copy of the page to the forum.

Hope this helps

Sign in to reply to this post

sudeep.pavithran374974

Data Assist problems solved!

Hi Craig,

All the issues got resolved. Thanks for your time & help!..

It was just because of my inexperience in php.

I must say, Data Assist is really a good tool for users like me.

Thanks once again!

Regards,
Sudeep K Pavithran

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