ideasworking
Programmer
Hello,
About a week or so ago I upgrade PHP to version 5.2 and ever since I have had trouble with mssql_query. I'm trying to delete a record and the query fails to delete the record.
The query looks fine it's....
Here's my code. Any idea why this isn't working?
Thanks,
Lou
About a week or so ago I upgrade PHP to version 5.2 and ever since I have had trouble with mssql_query. I'm trying to delete a record and the query fails to delete the record.
The query looks fine it's....
DELETE FROM GTG_LOG WHERE DateAndTime = '2007-1-8 1:29'
Here's my code. Any idea why this isn't working?
Thanks,
Lou
Code:
$RecDate=$_POST['OldRecordDate'];
$FirstofMonth = date("Y-m-d",mktime(0,0,0,date("m",strtotime($RecDate)) ,1,date("Y",strtotime($RecDate))));
$db = mssql_connect("SERVER\INSTANCE","sa","*****") or die("Unable to connect to server");
mssql_select_db("Reporting");
$QuerySQL = "DELETE FROM GTG_LOG WHERE DateAndTime = '".Date('Y-n-j G:i',strtotime($RecDate))."'";
$result = mssql_query($QuerySQL,$db) or die('Unable to delete record');
header ("Location: [URL unfurl="true"]http://intranet/logs.php?StartDate=".$FirstofMonth);[/URL]