0 hoặc $search khác rỗng tức là có dữ liệu mối show ra nhé, ngược lại thì báo lỗi. if ($num > 0 && $search != "") { // Dùng $num để đếm số dòng trả về. echo "$num ket qua tra ve voi tu khoa $search"; // Vòng lặp while & mysql_fetch_assoc dùng để lấy toàn bộ dữ liệu có trong table và trả về dữ liệu ở dạng array. while ($row = mysql_fetch_assoc($sql)) { $id = $row['user_id']; $username = $row['username']; $password = $row['password']; $email = $row['email']; $address = $row['address']; echo "
Ho ten: $username (id: $id)
Mat Khau: $passwordEmail: $emailDia chi: $address"; } } else { echo "Khong tim thay ket qua!"; } } } ?>
0 nhận xét:
Đăng nhận xét