您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

SAE上连接MySQL数据库_MySQL

2024/12/6 10:28:44发布19次查看
在sae上部署自己的代码后,肯定是需要连接到sae 的数据库的,接下来看看如何实现数据库的连接。sae连接数据库已经被模块化, 只需要使用saemysql类即可实现。
getdata( $sql );$name = strip_tags( $_request['name'] );$age = intval( $_request['age'] );$sql = insert into `user` ( `name`, `age`, `regtime`) values (' . $mysql->escape( $name ) . ' , ' . intval( $age ) . ' , now() ) ;$mysql->runsql($sql);if ($mysql->errno() != 0){ die(error: . $mysql->errmsg());}$mysql->closedb();?>
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product