This topic is locked

Empty 'Data'

2/9/2008 7:05:42 AM
PHPRunner General questions
S
smcgo4 author

Hi
I Have the following code as part of my Before Record Added event:
*// Parameters:

// $values - Array object.

// Each field on the Add form is represented as a 'Field name'-'Field value' pair
// If action is Think Tank

//** Insert a record into another table ****

if ($values["SuggestedAction"]=6)

{

global $conn;
$str = "INSERT INTO thinktank (StudentId, ReferDate) values (";
$str .= $values["StudentId"];

$str .= ",";

$str .= $values["IncidentDateAndTime"];

$str .= ")";
// echo $str;

// return true;
db_exec($str,$conn);
}
*

When it is executed it produces the following output:
INSERT INTO thinktank (StudentId, ReferDate) values (,)
I know I must be doing something wrong that is simple, but can't work it out.

S
smcgo4 author 2/9/2008

Ooops - I figured it out <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=25670&image=1&table=forumreplies' class='bbc_emoticon' alt=':blink:' /> It was a simple matter of not using the right case in the statements. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=25670&image=2&table=forumreplies' class='bbcemoticon' alt='<<' />