This topic is locked
[SOLVED]

 Still being confused

12/30/2009 3:27:55 AM
PHPRunner General questions
M
Mariah author

Hi there
Love the tool and am able to build quite an extensive and complex web within a few hours just using what is available! However still getting confused with syntax ( I think <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=13446&image=1&table=forumtopics' class='bbc_emoticon' alt=':blink:' /> I need a hint) inserting a simple record into another table after succesful login. Just looking over something...)
Table in MySql

CREATE TABLE IF NOT EXISTS md31350db105336.tblActivity (

fldActivity INT NOT NULL AUTO_INCREMENT ,

fldDateTime DATETIME NOT NULL ,

fldUserID VARCHAR(45) NULL DEFAULT NULL ,

fldUserName VARCHAR(45) NULL DEFAULT NULL ,

fldActivityText VARCHAR(45) NULL DEFAULT NULL ,

PRIMARY KEY (fldActivity) )

ENGINE = InnoDB
Insert after succesfull login:
//** Insert a record into another table ****

global $conn;

$strSQLInsert = "insert into tblActivity (fldActivity, fldDateTime, fldUserID, fldUserName, fldActivityText) values (1, current_timestamp, $username, $data["fldLastName"], 'Succesful Login')";

db_exec($strSQLInsert,$conn);
Error after building:
Parse error: syntax error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /storage/mijndomein/users/**/public/sites/www.**/include/events.php on line 15
Thanks for any hint......

H
htwebdev 12/30/2009



Error after building:
Parse error: syntax error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /storage/mijndomein/users/**/public/sites/www.**/include/events.php on line 15



this usually means you've forgotten the ";" at the end of the line above the error line. so look on line 14 and see if there is a semicolon there.

Sergey Kornilov admin 12/30/2009

Use single quotes in $data['fldLastName']