[PHP] Validasi Data | Uphik Lamers

Saturday, April 20, 2013

[PHP] Validasi Data

 











<?
//Koneksi Ke database
$dbserver="localhost";
$dbusername="root";
$dbpassword="root";
$dbname="test";

mysql_connect($dbserver,$dbusername,$dbpassword) or die(mysql_error());
mysql_select_db($dbname) or die (mysql_error());

$query = mysql_query("select nim from tbl_mahasiswa where nama='computika' ");
if (mysql_num_rows($query)>0)
{ die("nim telah Terdaftar!"); }

?>
Post a Comment