insert into with select and passing variables

5 pts.
Tags:
PHP
SQL Server 2005
SQL Server errors
SQL Server Variables
This is driving me NUTZ ---- SQL Server 2005 and PHP the variable :t_id is being passed from other pages and works in other statements, but is not parsing within this statement. If I replace :t_id with say 30, it works just fine. I tried declaring a new variable and passing it to the statement, and get the same error. define("TF_T_INFO_INSERET", " insert into TFT (WG_ID,task_id,tf_id) SELECT (select WGID from LU_T where TID= :t_id ), :t_id , (select max(TF_ID) from LU_TF); "); ------------output -------------- Performing an upload: insert into TFT (WG_ID,task_id,tf_id) SELECT (select WGID from LU_T where TID= :t_id ),:t_id ,(select max(TF_ID) from LU_T); Binding value :t_id to 30 ------ ERROR --- An error was encountered while saving: [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error (SQLExecute[0] at extpdo_odbcodbc_stmt.c:133) ---------------- Thanks B

Answer Wiki

Thanks. We'll let you know when a new response is added.

Fire up SQL Profiler and see what the actual command is that is being run against the SQL Server.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following