This topic is locked
[SOLVED]

 Not sure how to format this line

10/27/2010 9:00:16 PM
PHPRunner General questions
K
karmacomposer author

$sql="SELECT UserID FROM UserValidation WHERE GroupID=".$_SESSION["GroupID"]."=1";

printf("Selection SQL: %s\n", $sql);

$rs=CustomQuery($sql);

$RecData=db_fetch_array($rs);
global $conn,$strUserValidation;

$strSQLSave = "INSERT INTO RecruiterNames (UserID) values (";

$strSQLSave .= "'".$RecData['UserID']."'";

$strSQLSave .= ")";

db_exec($strSQLSave,$conn
I know line 1 is wrong. How should it be formatted to work? I am trying to say that I want to set the value of UserID if the GroupID=1
Thanks.
Mike

K
karmacomposer author 10/27/2010

$sql="SELECT UserID FROM UserValidation WHERE $_SESSION[".CHR(34).$_SESSION["GroupID"].CHR(34)."]=1";
This doesn't work either, but looks right (to me).
I'll keep trying.
Maybe someone will kindly advise me.
Mike

K
karmacomposer author 10/27/2010

I was advised to try the following:
$sql="SELECT UserID FROM UserValidation WHERE GroupID = 1";

printf("Selection SQL: %s\n", $sql);

$rs=CustomQuery($sql);

$RecData=db_fetch_array($rs);
global $conn,$strUserValidation;

$strSQLSave = "INSERT INTO RecruiterNames (UserID) values (";

$strSQLSave .= "'".$RecData['UserID']."'";

$strSQLSave .= ")";

db_exec($strSQLSave,$conn
Why do I still get a
syntax error, unexpected ';' in line 10
in PHPRunner
Mike

Sergey Kornilov admin 10/27/2010

The last line of your code looks truncated.

K
karmacomposer author 10/27/2010



The last line of your code looks truncated.


Yes. I discovered that, but thank you.
Mike