php新手注意事项
2021-01-08 02:29
标签:ase json data try mys for reac 新手 形式 1, $a = [1,2,3,5]; foreach($a as $item){ //1,2,3,5,1,2,3,3, 2,PHP Version 5.6.9、 $i = 2147483648232; //int(232) int(342391) 不知道问什么 --- try无法获取pdo的exception try{ --- try{ php新手注意事项 标签:ase json data try mys for reac 新手 形式 原文地址:https://www.cnblogs.com/Crius/p/13549498.html
foreach($a as &$item){
echo $item . ‘,‘;
}
echo $item . ‘,‘;
}
exit;
$b = intval($i);
var_dump($b);
$i = 01234567893456789334567;
var_dump(intval($i));
exit;
$pdo=new pdo("mysql:host=127.0.0.1:3308;dbname=brush","root","root");
//主动以警告的形式报错
$pdo->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION );
}catch(PDDException $e){
die(json_encode($e));
echo"数据库连接错误";exit;
}
$a = $pdo->query("show databases; ");
foreach ($a as $key => $value) {
# code...
var_dump($value);
}
}catch(PDDException $e){
echo"数据库query错误";exit;
}