熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> PHP編程 >> 正文

php 對 mysql數據庫的增,刪,該,查

2022-06-13   來源: PHP編程 

  php 對 mysql數據庫的增

  $dbhost=localhost;

  $dbuser =admin;

  $dbpass =;

  $dbname = lch;

  $conn = mysql_connect($dbhost$dbuser$dbpass$dbname)

  if($conn)

  {

  echo connect;

  }else

  {

  echo ;

  }

  mysql_select_db($dbname$conn)

  $sql = insert into ;

  $sql =user(tripal_idcompany_idusernameemailnamecreditparent_idpasswordsettle_passwordlognumlast_loginnew_fan_numremember_me_num

  is_adminis_bbis_bc);

  $sql =values(namelingnullnull ::;

  mysql_query($sql) or die(insert data failed cause: mysql_error())

  $select = select * from user ;

  $result =  mysql_query($select) or die(select data failed cause: mysql_error())

  print_r(mysql_fetch_array($result))

  $update = update user set email = where id =;

  echo $update;

  mysql_query($update) or die(update data failed cause: mysql_error())

  $delete = delete from user where id = ;

  mysql_query($delete) or die(delete data failed cause: mysql_error())


From:http://tw.wingwit.com/Article/program/PHP/201311/20838.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.