Ngày đăng: 02/07/2018
gọi biến $bien
mình mới học php, anh, em cho hỏi ngu cái... cảm ơn!!!
mình muốn gọi biến từ một trên 2 file php
trong file database.php mình đặt một hàm
<?php $db = mysqli_connect("localhost","root","","chevro41_chevrolet");
trong file index.php minh đặt một hàm
class thongke { function online() { #gọi biến $db $sql = mysqli_query( $db,"select * from useronline"); $n = mysqli_num_rows($sql); return $n; } }