易截截图软件、单文件、免安装、纯绿色、仅160KB

php程序插数据入mysql, 插入失败问题

注意:引用"肥占的博客 http://fatjames.extjs.org.cn/archives/40"
mysql5.x sql-mode 引起的错误
今天安装了个mysql5.0,拿了一个很久之前网上下的程序检查一下是否工作正常.
发现以前的程序居然不能正常运行,提示信息如下:
Database error: Invalid SQL: INSERT INTO
Survey_UserHistory(userId,jobId,type,action,startTime,endTime)
VALUES(‘17′,”,’User’,'Login’,”,’2008-11-23 14:33:56′)
MySQL error: 1366 (Incorrect integer value: ” for column ‘jobId’ at row 1)
Session halted.
第一时间的反应是跟mysql5.0新加的sql-mode有关系,因为前一阵子刚刚看过手册.果然,作了如下更改后就不再提示了.
修改 my.ini 文件.
# Set the SQL mode to strict
sql-mode=”STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”
改为:
# Set the SQL mode to strict
sql-mode=”NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”


相关文档:

sphinx整合到mysql(master/slave)中

sphinx版本使用的是coreseek修改的支 持中文检索的版本,中文词库使用 coreseek开发的libmmseg
mysql受sphinx中sphinxse引擎要求安装了mysql-5.0.37做生产环境的mysql-5.0.70的从库
编译sphinx,libmmseg以及mysql:
编译安装libmmseg:
./configure --prefix=/usr/local/mmseg && make -j5 && make instal ......

用PHP构建自定义搜索引擎Sphinx

1. 创建索引
$ sudo /usr/local/bin/indexer --config /usr/local/etc/sphinx.conf --all
Sphinx 0.9.7
Copyright (c) 2001-2007, Andrew Aksyonoff
using config file '/usr/local/etc/sphinx.conf'...
indexing index 'catalog'...
collected 8 docs, 0.0 MB
sorted 0.0 Mhits, 82.8% done
total 8 docs, 149 byt ......

几种常用PHP连接数据库的代码

PHP连接数据库之PHP连接MYSQL数据库代码 < ?php   
$mysql_server_name='localhost'; 
//改成自己的mysql数据库服务器  
$mysql_username='root'; 
//改成自己的mysql数据库用户名  
$mysql_password='12345678'; 
//改成自己的mysql数据库密码 &nb ......

MYSQL 字符集问题

 
 
 
MySQL的字符集支持(Character Set Support)有两个方面:
     字符集(Character set)和排序方式(Collation)。
对于字符集的支持细化到四个层次:
     服务器(server),数据库(database),数据表(table)和连接(connection)。
1.MySQL默认字符集
  ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号