biircoop Posted June 18, 2009 Share Posted June 18, 2009 Please help! I am getting this error: Warning: mssql_query() [function.mssql-query]: message: Line 2: Incorrect syntax near '<'. (severity 15) in E:\Inetpub\wwwroot\securty_tracking\admin_task_daily.php on line 39. The value of $dow should be the day of the week: Sunday, Monday, etc. 'hours_spent' is input from a text box. Let me know if you need anything else. Here is the php code that I am trying to use. Line 39 is the execution of $sql_update. This causes a fail of the query. $sql_insert="INSERT INTO TICKETS_DAILY VALUES(".$ticket_id.",'".trim(strtoupper($_SESSION['username'])). "', ".$req_id.",0,0,0,0,0,0,0)"; mssql_query($sql_insert); $sql_update="UPDATE TICKETS_DAILY SET ".$_REQUEST['dow']."=".$_REQUEST['hours_spent']. " WHERE ticket_id=".$ticket_id. " AND accepted_by='".trim(strtoupper($_SESSION['username']))."' AND req_id=".$req_id; mssql_query($sql_update); Link to comment https://forums.phpfreaks.com/topic/162814-incorrect-syntax/ Share on other sites More sharing options...
Maq Posted June 18, 2009 Share Posted June 18, 2009 Echo $sql_update to see what the actual values are. Please use tags around your code. Link to comment https://forums.phpfreaks.com/topic/162814-incorrect-syntax/#findComment-859165 Share on other sites More sharing options...
EchoFool Posted June 18, 2009 Share Posted June 18, 2009 mssql_query($sql_insert); To mysql_query($sql_insert); Link to comment https://forums.phpfreaks.com/topic/162814-incorrect-syntax/#findComment-859167 Share on other sites More sharing options...
Maq Posted June 18, 2009 Share Posted June 18, 2009 mssql_query($sql_insert); To mysql_query($sql_insert); I think it's safe to assume he's using Microsoft SQL Server. Link to comment https://forums.phpfreaks.com/topic/162814-incorrect-syntax/#findComment-859170 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.