2014
11-07
11-07
PHP数据库抽象层之PDO(七)——相关类和方法
PDO类代表PHP和数据库服务之间的一个连接PDO::beginTransaction —启动一个事务PDO::commit —提交一个事务PDO::__construct —创建一个表示数据库连接的PDO实例PDO::errorCode —获取跟数据库句柄上一次操作相关的SQLSTATEPDO::errorInfo —FetchextendederrorinformationassociatedwiththelastoperationonthedatabasehandlePDO::exec —执行一条SQL语句,并返回受影响的行数PDO::get...
继续阅读 >
范例Example#1使用PHP创建PNG格式图片<?phpheader("Content-type: image/png");$string = $_GET['text'];$im = imagecreatefrompng("images/button1.png");$orange = imagecolorallocate($im, 220, 210, 60);$px = (imagesx($im) - 7.5 * strlen($string)) / 2;imagestring($im, 3, $px, 9, $string, $o...
Example#1在Imagick中创建缩略图<?phpheader('Content-type: image/jpeg');$image = new Imagick('image.jpg');// If 0 is provided as a width or height parameter,// aspect ratio is maintained$image->thumbnailImage(100, 0);echo $image;?>Example#2MakeathumbnailofallJPGfilesinadirectory<?php$...
mail() 函数可以让你发送邮件。为了使右键函数正常运行,PHP必须在编译时访问你系统里的 sendmail 可执行文件。如果你使用了其他邮件程序,例如 qmail 或者 postfix,请确保它们使用了与sendmail适配的包装器。PHP首先会在你的 PATH 变量里查找sendmail,然后在下面的路径里查找:/usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib。强烈建议sendmail在您的 PATH 变量里。并且,运行编译后PHP程序的用...