This topic is locked
[SOLVED]

 Button to Insert Record

12/2/2013 6:57:08 PM
PHPRunner General questions
C
CWDATA author

Can anyone see why this is not working from On Server Event of Button.
$record = $button->getCurrentRecord();

$sql = "INSERT INTO pgmanagement_dbs.tblClientTabV2(ClientName,

SwitchboardPhone)

SELECT Company Name, Phone Number FROM pgmanagement_dbs.tblprospectdataV2

WHERE Unique ID=" . $record['Unique ID'];

Sergey Kornilov admin 12/2/2013

Your code is not complete, you preparing SQL statement but not executing it.
And as a rule of thumb - print the SQL query and execute it manually against your database. This definitely the best way to find what is wrong or missing.