gino CMS  2.5.0
gino è un CMS scritto in PHP che offre tutti gli strumenti necessari per poter creare un sito web e gestire i contenuti al suo interno in maniera semplice ed efficace, svincolando l'amministratore da conoscenze tecniche di programmazione
sqlsrv Class Reference

Libreria di connessione ai database SQL Server. More...

Inheritance diagram for sqlsrv:
Collaboration diagram for sqlsrv:

Public Member Functions

 __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)
 

Data Fields

 $_db_name
 
 $_db_user
 
 $_db_password
 
 $_db_charset
 
 $_dbconn
 

Private Member Functions

 setParamsCache ()
 Parametri inerenti la cache delle query presenti nelle Impostazioni di sistema. More...
 
 setsql ($sql_query)
 Imposta la query come proprietà More...
 
 setNumberRows ($numberresults)
 
 setconnection ($connection)
 
 queryResults ($query, $options=array())
 Esegue la query e ne calcola i tempi di esecuzione. More...
 
 listTables ()
 
 limitQuery ($fields, $tables, $where=null, $options=array())
 

Private Attributes

 $_db_host
 
 $_sql
 
 $_qry
 
 $_numberrows
 
 $_connection
 
 $_rows
 
 $_affected
 
 $_lastid
 
 $_dbresults = array()
 
 $_show_stats
 
 $_info_queries
 
 $_cnt
 
 $_time_queries
 
 $_query_cache
 
 $_query_cache_time
 
 $_cache
 

Detailed Description

Libreria di connessione ai database SQL Server.

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.

Constructor & Destructor Documentation

__construct (   $params)

Costruttore.

Parameters
array$paramsparametri 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.

Member Function Documentation

autoIncValue (   $table)

Ottiene il valore del campo AUTO_INCREMENT.

See also
DbManager::autoIncValue()

Implements DbManager.

begin ( )
See also
DbManager::begin()

Implements DbManager.

changeFieldType (   $data_type,
  $value 
)
closeConnection ( )
columnHasValue (   $table,
  $field,
  $value,
  $options = array() 
)
commit ( )

Per tabelle innodb.

See also
DbManager::commit()

Implements DbManager.

concat (   $sequence)
See also
DbManager::concat()

Implements DbManager.

conformFieldType (   $type)

Uniforma i tipi di dato dei campi.

Parameters
integer$type
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
char1
date91
datetime93
datetime293
datetimeoffset-155
decimal3
float6
image-4
int4
money3
nchar-8
ntext-10
numeric2
nvarchar-9
real7
smalldatetime93
smallint5
Smallmoney3
text-1
time-154
timestamp-2
tinyint-6
udt-151
uniqueidentifier-11
varbinary-3
varchar12
xml-152

Implements DbManager.

delete (   $table,
  $where,
  $debug = false 
)
See also
DbManager::delete()

Implements DbManager.

distinct (   $fields,
  $options = array() 
)
See also
DbManager::distinct()

Implements DbManager.

drop (   $table)
See also
DbManager::drop()

Implements DbManager.

dump (   $table,
  $filename,
  $options = array() 
)
See also
DbManager::dump()

Implements DbManager.

dumpDatabase (   $file)
escapeString (   $string)
See also
DbManager::escapeString()

Implements DbManager.

execCustomQuery (   $query,
  $options = array() 
)
fieldInformations (   $table)
See also
DbManager::fieldInformations()
conformFieldType()

La funzione sqlsrv_field_metadata() ritorna i riferimenti:

NameThe name of the field.
TypeThe numeric value for the SQL type.
SizeThe number of characters for fields of character type, the number of bytes for fields of binary type, or NULL for other types.
PrecisionThe precision for types of variable precision, NULL for other types.
ScaleThe scale for types of variable scale, NULL for other types.
NullableAn enumeration indicating whether the column is nullable, not nullable, or if it is not known.

Implements DbManager.

freeresult (   $res = null)
See also
DbManager::freeresult()

Implements DbManager.

getFieldFromId (   $table,
  $field,
  $field_id,
  $id,
  $options = array() 
)
getInfoQuery ( )
See also
DbManager::getInfoQuery()

Implements DbManager.

getLastId (   $table)
See also
DbManager::getLastId()

Implements DbManager.

getNumRecords (   $table,
  $where = null,
  $field = 'id',
  $options = array() 
)
insert (   $fields,
  $table,
  $debug = false 
)
See also
DbManager::insert()

Implements DbManager.

join (   $table,
  $condition,
  $option 
)
See also
DbManager::join()

Implements DbManager.

limit (   $range,
  $offset = 0 
)
See also
Gino.DbManager::limit()

Examples

//Returning the first 100 rows from a table called employee:
select top 100 * from employee
//Returning the top 20% of rows from a table called employee:
select top 20 percent * from employee

Implements DbManager.

limitQuery (   $fields,
  $tables,
  $where = null,
  $options = array() 
)
private
listTables ( )
private
multiActionQuery (   $file_content)
openConnection ( )
See also
DbManager::openConnection()

L'estensione SQLSRV restituisce oggetti DateTime.
È possibile disabilitare la funzione utilizzando l'opzione di connessione ReturnDatesAsStrings.

See also
https://msdn.microsoft.com/en-us/library/ff628167.aspx

Implements DbManager.

query (   $fields,
  $tables,
  $where = null,
  $options = array() 
)
queryResults (   $query,
  $options = array() 
)
private

Esegue la query e ne calcola i tempi di esecuzione.

Parameters
string$queryquery da eseguire
array$optionsarray associativo di opzioni
  • statement (string): tipologia di query
    • select (default)
    • action
Returns
mixed
See also
http://msdn.microsoft.com/en-us/library/hh487160.aspx
restore (   $table,
  $filename,
  $options = array() 
)
See also
DbManager::restore()

Implements DbManager.

rollback ( )

Per tabelle innodb.

See also
DbManager::rollback()

Implements DbManager.

select (   $fields,
  $tables,
  $where = null,
  $options = array() 
)
See also
DbManager::select()

Implements DbManager.

setconnection (   $connection)
private
setNumberRows (   $numberresults)
private
setParamsCache ( )
private

Parametri inerenti la cache delle query presenti nelle Impostazioni di sistema.

Returns
void
setsql (   $sql_query)
private

Imposta la query come proprietà

Parameters
string$sql_queryquery
tableexists (   $table)
See also
DbManager::tableexists()

Implements DbManager.

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 
)
See also
DbManager::update()

Implements DbManager.

Field Documentation

$_affected
private
$_cache
private
$_cnt
private
$_connection
private
$_db_charset
$_db_host
private
$_db_name
$_db_password
$_db_user
$_dbconn
$_dbresults = array()
private
$_info_queries
private
$_lastid
private
$_numberrows
private
$_qry
private
$_query_cache
private
$_query_cache_time
private
$_rows
private
$_show_stats
private
$_sql
private
$_time_queries
private

The documentation for this class was generated from the following file: