$conn = new PDO($dsn, $db_user, $db_password) $dsn = "mysql:host=localhost dbname=test " ) ENGINE=InnoDB DEFAULT CHARSET=latin1 //Create Connection It does not return results from a SELECT statement. If the last SQL statement executed by the associated PDOStatement was a SELECT statement, some database may return the number of rows returned by the statement.Įxec($sql_statement) – It executes an SQL statement in a single function call, returning the number of rows affected by the statement. HOSPITAL MANAGEMENT SYSTEM PROJECT IN PHP PDO UPDATEIt returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement executed by the corresponding PDOStatment object. PDO::FETCH_NAMED: It returns an array with the same form as PDO:: FETCH_ASSOC, except that if there are multiple columns with the same name, the value referred to by that key will be an array of all the values in the row that had that column name. PDO::FETCH_OBJ: It returns an anonymous object with property names that correspond to the column names returned in your result set. PDO::FETCH_NUM: It returns an array indexed by column number(index array) as returned in your result set, starting at column 0. PDO::FETCH_ASSOC: It returns an array indexed by column name(associative array) as returned in your result set. PDO:: FETCH_BOTH(default): It returns an array indexed by both column name and 0-indexed column number as returned in your result set. It controls how the next row will be returned to the caller. The fetch_style parameter determines how PDO returns the row. An empty array is returned if there are zero results to fetch, or FALSE on failure.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |