<?php
$sql ="select * from student order by id asc ";
$query=mysql_query($sql) or die(mysql_error());
$num=mysql_num_rows($query);
echo $num;
?>
$sql ="select * from student order by id asc ";
$query=mysql_query($sql) or die(mysql_error());
$num=mysql_num_rows($query);
echo $num;
?>
ตัวแปร sql - เลือกทุกฟิลด์จากเทเบิล student เรียงจากฟิลด์ id น้อยไปมาก
ตัวแปร query - ฟังก์ชันที่ใช้ประมวลผล sql และตรวจสอบว่าถูกหรือไม่
ตัวแปร
num - ประมวลโดยนับจำนวน record ของ ตัวแปร query และแสดงผลตัวแปร num
ไม่มีความคิดเห็น:
แสดงความคิดเห็น