This topic is locked
[SOLVED]

 Update field in master Table

10/25/2011 12:07:59 PM
PHPRunner General questions
R
remyuk author

Hello there,
Im making a Crm for my call centre, so basically, when an agent wants insert a new lead Into the database ('Lead' Table), I have a read only field that puts the status of the lead as 'NEW'.
I have another table called 'Lead Management' with the same fields and also with the field 'status'. With PHPRunner:
1- in the sql editor, I changed the settings to get 'New' Lead from 'lead' Table.

2- in the visual editor, I put a dropdown box with different status (Pending, Cancelled ..) in 'lead management' edit page.
until this point everything works...
But when I want to change statut, it does not save the new status....
I tried everything....
if you have any idea, feel free. thanks a lot.

C
cgphp 10/25/2011

Post the tables fields and the query you are using.

R
remyuk author 10/26/2011



Post the tables fields and the query you are using.


Hi,
Table 'lead'

LeadID

Client Name

Campaign Name

ID

Product

UserID

Statut

Date

Company Name

Registered Number

Postcode

Firstname

Surname

Address1

Address2

Address3

Town

Type
Table 'Lead management'

LeadID

ID

Client Name

Campaign Name

Product

Statut

UserID

Company Name
and in 'Lead management'

Edit page : Before record updated
global $conn,$strTableName;
$strSQLSave = "INSERT INTO Lead (Statut, LeadID) values (";
$strSQLSave .= $values["Statut"].",";
$strSQLSave .= $values["LeadID"];
$strSQLSave .= ")";
db_exec($strSQLSave,$conn);
Any idea...? Thanks for your answers..

R
remyuk author 10/27/2011



Hi,
Table 'lead'

LeadID

Client Name

Campaign Name

ID

Product

UserID

Statut

Date

Company Name

Registered Number

Postcode

Firstname

Surname

Address1

Address2

Address3

Town

Type
Table 'Lead management'

LeadID

ID

Client Name

Campaign Name

Product

Statut

UserID

Company Name
and in 'Lead management'

Edit page : Before record updated
global $conn,$strTableName;
$strSQLSave = "INSERT INTO Lead (Statut, LeadID) values (";
$strSQLSave .= $values["Statut"].",";
$strSQLSave .= $values["LeadID"];
$strSQLSave .= ")";
db_exec($strSQLSave,$conn);
Any idea...? Thanks for your answers..


I found out a solution: just create 'custom view', and that's it .... It's quite DIY, but it works. thanks anyway.