stockton Posted October 12, 2006 Share Posted October 12, 2006 Am I misunderstanding the PHP Manual, where it says:-mixed *mssql_query* ( string query [, resource link_identifier [, int batch_size]] )Returns: A MS SQL result resource on success, *TRUE* if no rows were returned, or *FALSE* on error. and my code reads:-$insert = sprintf("INSERT INTO Users (FirstName, LastName, Usrname,Passwrd, AccessLevel, last_login,UserID) VALUES ('%s', '%s', '%s', '%s', '%d', '%s', '%d')", $FirstName, $Surname, $uname, $passwd,$accesslevel, $regdate, $_SESSION['UID']);$Reply = mssql_query($insert, $link);if ($Reply == FALSE) {whether the query works or not I have yet to find $Reply equal to FALSE.Please tell me what I am misunderstanding and what is the correct method ???? Link to comment https://forums.phpfreaks.com/topic/23754-checking-for-result-of-call-to-mssql_query/ Share on other sites More sharing options...
shivabharat Posted October 13, 2006 Share Posted October 13, 2006 You dont have to explicitly check for true or false.[code]$insert = sprintf("INSERT INTO Users (FirstName, LastName, Usrname,Passwrd, AccessLevel, last_login,UserID) VALUES ('%s', '%s', '%s', '%s', '%d', '%s', '%d')", $FirstName, $Surname, $uname, $passwd,$accesslevel, $regdate, $_SESSION['UID']);$Reply = mssql_query($insert, $link);if ($Reply) { echo "Data Inserted";}else{ echo "Not Inserted";}[/code] Link to comment https://forums.phpfreaks.com/topic/23754-checking-for-result-of-call-to-mssql_query/#findComment-108443 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.