Both bindParam and bindValue are the inbuilt functions of PHP which are used for accessing database records by mapping variable to the value in PHP data objects statement also known as PDOStatement which is nothing else but is an abstraction layer for database queries.
Following are the important differences between ASP and ASP.NET.
|Sr. No.||Key||bindParam function||bindValue function|
|1||Definition||bindParam is a PHP inbuilt function used to bind a parameter to the specified variable name in a sql statement for access the database record.||bindValue, on the other hand, is again a PHP inbuilt function used to bind the value of parameter to the specified variable name in sql statement.|
|2||Execution||bindParam function is executed only at the execution of statement i.e $stmt -> bindParam(':variableName', $parameter); is called.||On other hand bindValue is compiled and assign its value at the time of its declaration i.e $stmt->execute();|
|3||Accessed Value||As mentioned in above point bindParam is executed at the execution of statement, so the latest value mapped with parameter is being used by the statement.||While on other hand, in case of bindValue the value gets assigned to the parameter at the time of declaration of the function used by the statement.|
|4||Type||As mentioned in above point bindParam function is of runtime execution type.||On other hand bindValue function is of compiled execution type.|
|5||Modified Value||In case of bindParam modification in parameter value is possible and would get executed by the statement.||On other hand in case of bindValue modification in parameter value is not possible and only the initial value get executed by the statement.|