Улучшенный модуль MySQL (Improved)
- Введение
- Installing/Configuring
- Предопределенные константы
- mysqli — Расширение MySQL (Improved)
- mysqli_bind_param — Синоним функции mysqli_stmt_bind_param
- mysqli_bind_result — Синоним функции mysqli_stmt_bind_result
- mysqli_client_encoding — Синоним функции mysqli_character_set_name
- mysqli_disable_reads_from_master — Блокирует чтение с мастера
- mysqli_disable_rpl_parse — Блокировать разбор RPL
- mysqli_enable_reads_from_master — Включает чтение с мастера
- mysqli_enable_rpl_parse — Включает разбор RPL
- mysqli_escape_string — Синоним функции mysqli_real_escape_string
- mysqli_execute — Alias for mysqli_stmt_execute
- mysqli_fetch — Alias for mysqli_stmt_fetch
- mysqli_get_metadata — Alias for mysqli_stmt_result_metadata
- mysqli_master_query — Enforce execution of a query on the master in a master/slave setup
- mysqli_param_count — Alias for mysqli_stmt_param_count
- mysqli_report — Enables or disables internal report functions
- mysqli_rpl_parse_enabled — Check if RPL parse is enabled
- mysqli_rpl_probe — RPL probe
- mysqli_rpl_query_type — Returns RPL query type
- mysqli_send_long_data — Alias for mysqli_stmt_send_long_data
- mysqli_send_query — Send the query and return
- mysqli_set_opt — Alias of mysqli_options
- mysqli_slave_query — Force execution of a query on a slave in a master/slave setup
Коментарии
How to do?
I try to "shift" JPEG-files and RAW-files into a LONG_BLOB-field in my database. When I use following:
$db = ... connect to MYSQL-database;
$dir = opendir($specialdirectory);
$filename = readdir($dir);
$handle = fopen($specialdirectory.$filename);
$picture = stream_get_contents($handle);
$sql = "INSERT INTO table SET xyz=.... , picture=`".$picture."`";
if (!$res = $db->query($sql)) { error handling ....
// the field "picture" bounced against $picture
}
with:
$dump = bin2hex($picture);
$sql = "INSERT INTO table SET xyz=...., picture=`".$picture."`";
// no error occurs.... but the content of the LONG_BLOB-field picture
// is not usable as a JPEG or RAW picture.... it is destroyed.
WHY???