This topic is locked

insert recort or update?

9/11/2008 9:31:37 AM
PHPRunner General questions
scuba author

Hi there,
I'm trying to update a record in tableA with additional data coming from tableB when user edits the record in tableB. Both tabels are linked by an autoincremented id-field. Here's what I've tried (doesn't work)
[codebox]global $conn;

$strUpdate = "UPDATE ges_dwh_v2 set inqdet_series_1=".$values["inq_series"]" where id=".$values["id"];

db_exec($strUpdate,$conn);[/codebox]
thanks for your continued help!!

Sergey Kornilov admin 9/11/2008

Print this query on the web page and run against your database manually to see what exactly doesn't work.

global $conn;

$strUpdate = "UPDATE ges_dwh_v2 set inqdet_series_1=".$values["inq_series"]" where id=".$values["id"];

echo $strUpdate;

//db_exec($strUpdate,$conn);
scuba author 9/12/2008

Print this query on the web page and run against your database manually to see what exactly doesn't work.

global $conn;

$strUpdate = "UPDATE ges_dwh_v2 set inqdet_series_1=".$values["inq_series"]" where id=".$values["id"];

echo $strUpdate;

//db_exec($strUpdate,$conn);


Serge, I'm not sure what exactly you mean with "print it to the webpage..."

This is the error message I get:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /homepages/24/d114988156/htdocs/sub/ges_dwh/test_server/gesdb_inquiries/include/ges_dwh_v2_events.php on line 346

J
Jane 9/12/2008

Try to use this code:

global $conn;

$strUpdate = "UPDATE ges_dwh_v2 set inqdet_series_1=".$values["inq_series"]." where id=".$values["id"];

echo $strUpdate;

//db_exec($strUpdate,$conn);