Libreria di connessione ai database SQL Server.
More...
|
| | __construct ($params) |
| | Costruttore. More...
|
| |
| | getInfoQuery () |
| |
| | openConnection () |
| |
| | closeConnection () |
| |
| | begin () |
| |
| | rollback () |
| | Per tabelle innodb. More...
|
| |
| | commit () |
| | Per tabelle innodb. More...
|
| |
| | multiActionQuery ($file_content) |
| |
| | freeresult ($res=null) |
| |
| | getLastId ($table) |
| |
| | autoIncValue ($table) |
| | Ottiene il valore del campo AUTO_INCREMENT. More...
|
| |
| | getFieldFromId ($table, $field, $field_id, $id, $options=array()) |
| |
| | tableexists ($table) |
| |
| | fieldInformations ($table) |
| |
| | conformFieldType ($type) |
| | Uniforma i tipi di dato dei campi. More...
|
| |
| | limit ($range, $offset=0) |
| |
| | distinct ($fields, $options=array()) |
| |
| | concat ($sequence) |
| |
| | dumpDatabase ($file) |
| |
| | changeFieldType ($data_type, $value) |
| |
| | getNumRecords ($table, $where=null, $field='id', $options=array()) |
| |
| | query ($fields, $tables, $where=null, $options=array()) |
| |
| | execCustomQuery ($query, $options=array()) |
| |
| | select ($fields, $tables, $where=null, $options=array()) |
| |
| | insert ($fields, $table, $debug=false) |
| |
| | update ($fields, $table, $where, $debug=false) |
| |
| | delete ($table, $where, $debug=false) |
| |
| | drop ($table) |
| |
| | columnHasValue ($table, $field, $value, $options=array()) |
| |
| | join ($table, $condition, $option) |
| |
| | union ($queries, $options=array()) |
| |
| | restore ($table, $filename, $options=array()) |
| |
| | dump ($table, $filename, $options=array()) |
| |
| | escapeString ($string) |
| |
Libreria di connessione ai database SQL Server.
- Copyright
- 2013-2015 Otto srl (http://www.opensource.org/licenses/mit-license.php) The MIT License
- Author
- marco guidotti guido.nosp@m.ttim.nosp@m.@gmai.nosp@m.l.co.nosp@m.m
-
abidibo abidi.nosp@m.bo@g.nosp@m.mail..nosp@m.com
GESTIONE CODIFICA UTF8
In SQL Server occorre gestire la codifica UTF8 dei dati.
GESTIONE DATABASE/HTML
Dal database alla visualizzazione
In questo caso si passa attraverso il metodo Gino.convertToHtml() richiamato dai metodi htmlChars, htmlCharsText e htmlInput, presenti nel file func.var.php.
Dal form al database
I dati passano attraverso il metodo Gino.convertToDatabase() (file func.var.php) richiamato direttamente dalle librerie di connessione al database.
Costruttore.
- Parameters
-
| array | $params | parametri di connessione al database
- host (string): nome del server
- db_name (string): nome del database
- user (string): utente che si connette
- password (string): password dell'utente che si connette
- charset (string): encoding
- connect (boolean): attiva la connessione
|
- Returns
- void
Implements DbManager.
| changeFieldType |
( |
|
$data_type, |
|
|
|
$value |
|
) |
| |
| columnHasValue |
( |
|
$table, |
|
|
|
$field, |
|
|
|
$value, |
|
|
|
$options = array() |
|
) |
| |
| conformFieldType |
( |
|
$type | ) |
|
Uniforma i tipi di dato dei campi.
- Parameters
-
- Returns
- string
Tipi di dato riportati dalla funzione sqlsrv_field_metadata()
Per l'elenco fare riferimento alla documentazione ufficiale Microsoft:
http://msdn.microsoft.com/en-us/library/cc296197.aspx
| bigint | -5 |
| binary | -2 |
| bit | -7 |
| char | 1 |
| date | 91 |
| datetime | 93 |
| datetime2 | 93 |
| datetimeoffset | -155 |
| decimal | 3 |
| float | 6 |
| image | -4 |
| int | 4 |
| money | 3 |
| nchar | -8 |
| ntext | -10 |
| numeric | 2 |
| nvarchar | -9 |
| real | 7 |
| smalldatetime | 93 |
| smallint | 5 |
| Smallmoney | 3 |
| text | -1 |
| time | -154 |
| timestamp | -2 |
| tinyint | -6 |
| udt | -151 |
| uniqueidentifier | -11 |
| varbinary | -3 |
| varchar | 12 |
| xml | -152 |
Implements DbManager.
| delete |
( |
|
$table, |
|
|
|
$where, |
|
|
|
$debug = false |
|
) |
| |
| distinct |
( |
|
$fields, |
|
|
|
$options = array() |
|
) |
| |
| dump |
( |
|
$table, |
|
|
|
$filename, |
|
|
|
$options = array() |
|
) |
| |
| execCustomQuery |
( |
|
$query, |
|
|
|
$options = array() |
|
) |
| |
| fieldInformations |
( |
|
$table | ) |
|
- See also
- DbManager::fieldInformations()
-
conformFieldType()
La funzione sqlsrv_field_metadata() ritorna i riferimenti:
| Name | The name of the field. |
| Type | The numeric value for the SQL type. |
| Size | The number of characters for fields of character type, the number of bytes for fields of binary type, or NULL for other types. |
| Precision | The precision for types of variable precision, NULL for other types. |
| Scale | The scale for types of variable scale, NULL for other types. |
| Nullable | An enumeration indicating whether the column is nullable, not nullable, or if it is not known. |
Implements DbManager.
| freeresult |
( |
|
$res = null | ) |
|
| getFieldFromId |
( |
|
$table, |
|
|
|
$field, |
|
|
|
$field_id, |
|
|
|
$id, |
|
|
|
$options = array() |
|
) |
| |
| getNumRecords |
( |
|
$table, |
|
|
|
$where = null, |
|
|
|
$field = 'id', |
|
|
|
$options = array() |
|
) |
| |
| insert |
( |
|
$fields, |
|
|
|
$table, |
|
|
|
$debug = false |
|
) |
| |
| join |
( |
|
$table, |
|
|
|
$condition, |
|
|
|
$option |
|
) |
| |
| limit |
( |
|
$range, |
|
|
|
$offset = 0 |
|
) |
| |
| limitQuery |
( |
|
$fields, |
|
|
|
$tables, |
|
|
|
$where = null, |
|
|
|
$options = array() |
|
) |
| |
|
private |
| multiActionQuery |
( |
|
$file_content | ) |
|
| query |
( |
|
$fields, |
|
|
|
$tables, |
|
|
|
$where = null, |
|
|
|
$options = array() |
|
) |
| |
| queryResults |
( |
|
$query, |
|
|
|
$options = array() |
|
) |
| |
|
private |
| restore |
( |
|
$table, |
|
|
|
$filename, |
|
|
|
$options = array() |
|
) |
| |
| select |
( |
|
$fields, |
|
|
|
$tables, |
|
|
|
$where = null, |
|
|
|
$options = array() |
|
) |
| |
| setconnection |
( |
|
$connection | ) |
|
|
private |
| setNumberRows |
( |
|
$numberresults | ) |
|
|
private |
Parametri inerenti la cache delle query presenti nelle Impostazioni di sistema.
- Returns
- void
Imposta la query come proprietà
- Parameters
-
| union |
( |
|
$queries, |
|
|
|
$options = array() |
|
) |
| |
- See also
- DbManager::union()
In mssql possono essere utilizzati gli operatori:
- UNION, elimina le righe duplicate dai risultati combinati delle istruzioni SELECT
- UNION ALL, mostra i record duplicati
Implements DbManager.
| update |
( |
|
$fields, |
|
|
|
$table, |
|
|
|
$where, |
|
|
|
$debug = false |
|
) |
| |
The documentation for this class was generated from the following file: