Coding with SPIP 2.1
SPIP 2.1 Technical Documentation

> > > > sql_hex

sql_hex

The sql_hex() function returns a numeric value for a hexadecimal expression, transforming 09af into 0x09af (for MySQL and SQLite). This is principally used to write hexadecimal content into a numerically-typed SQL column.

It accepts 3 parameters:

  1. $val is the character string to be translated,
  2. $serveur,
  3. $option.

Usage:

  1. $hex = sql_hex('0123456789abcdef');
  2. sql_updateq('table', array('column'=>$hex), 'id_table=' . $id_table);

Download