php 连接数据库 , 插入记录
$username = "root";
$password = "123";
// 建立连接
mysql_connect('localhost', $username, $password);
// 选择连接数据库
mysql_select_db("test");
// 插入数据
mysql_query("insert into tb values (12)"); // 插入数据
相关文档:
Php Variable Circular References
Circular-references has been a long outstanding issue with PHP. They are
caused by the fact that PHP uses a reference counted memory allocation
mechanism for its internal variables. This causes problems for longer
running scripts (such as an Applicatio ......
在使用php中使用数据库事务处理并不复杂,主要用到的是mysqli类的3个成员函数。
(1)autocommit(bool mode),设置数据库自动提交状态。当mode为TRUE时,打开自动提交设置,当mode为FASLE时,关闭自动设置。所谓自动提交,就是MYSQL每执行一条SQL语句,该SQL语句的执行结果马上生效。而非自动提交时,则执行结果要一直到 ......
just get a json
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<mce:script src="jquery-1.3.2.min.js" mce_src="jq ......
首先,建InnoDB类型的表,才能支持事务
$handler = mysql_connect('localhost', '', '');
mysql_select_db('test');
mysql_query('SET AUTOCOMMIT=0'); // 设置为不自动提交查询
mysql_query('START TRANSACTION'); // 开始查询,这里也可以使用BEGIN
mysql_query("INSERT INTO users VALUES ('ccc')");
mysql_query( ......
php官方网站怎么就没有个详细的在windows上部署的文档呢
我在windows2003上部署php,老是出现404错误
查了google,按照上面说的增加了web扩展也不行
开了目录浏览,根目录下面居然没有index.php和其他的php文件
我人品看来不行了 ......