1.row_array():返回查询结果中的第一条数据

include APP_PATH . "../mysql.class.php";
$db = new mysql();
$sql ="select userid,appid,appsecret,authfields,authfilters,loanid,finid,apitype from boc_user_api where appid='$appid'";
$memberinfo = $db->row_array($sql);

2.result_array():以数组的形式返回所有的查询结果

include APP_PATH . "../mysql.class.php";
$db = new mysql();
$sql ="select userid,appid,appsecret,authfields,authfilters,loanid,finid,apitype from boc_user_api where appid='$appid'";
$memberinfo = $db->result_array($sql);

 3.query():执行非查询之外的sql语句

include APP_PATH . "../mysql.class.php";
$db = new mysql();
$sql ="insert into user (name,age) values ('花花',18)";
$ret = $db->query($sql);

 

相关文章:

  • 2021-12-04
  • 2021-08-15
  • 2022-12-23
  • 2021-07-04
  • 2021-10-28
  • 2021-05-19
  • 2022-12-23
猜你喜欢
  • 2022-01-09
  • 2021-08-30
  • 2022-12-23
  • 2021-05-19
  • 2021-09-11
  • 2021-06-21
相关资源
相似解决方案