好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

php使用mysqli连接数据库

= mysqli_connect( ‘localhost‘ , ‘root‘ , ‘‘ , ‘addressBook‘ ) or die( ‘Connect error!‘ ); $sql = "insert into " . $this ->tb_group. " value(‘‘, ‘ $name ‘, ‘ $pwd ‘, ‘ $numIdList ‘)" ; $result = $conn ->query( $sql ); //添加成功result的值为boolean值 true // $result = mysqli_query( $conn , $sql ); if ( $result ) { $lastid = mysqli_insert_id( $conn ); //刚刚插入数据库的记录id echo "<BR>新建通讯录成功!" ; } else { echo "<BR>新建通讯录失败!" ; } $(function () { $(‘pre.prettyprint code‘).each(function () { var lines = $(this).text().split(‘\n‘).length; var $numbering = $(‘ ‘).addClass(‘pre-numbering‘).hide(); $(this).addClass(‘has-numbering‘).parent().append($numbering); for (i = 1; i ‘).text(i)); }; $numbering.fadeIn(1700); }); });

php使用mysqli连接数据库

标签:php   mysqli   刚刚插入的id   

查看更多关于php使用mysqli连接数据库的详细内容...

  阅读:29次