create database okul
--------------------
create table ogrenci
(
no int(15),
ad varchar(15),
soyad varchar(15)
)
--------------------
ayar.php
<?
$host="localhost";
$kadi="root";
$sifre="";
$veritabani="okul";
$tablo="ogrenci";
$baglanti=mysql_connect($host,$kadi,$sifre);
if($baglanti)
{
echo"mysql sunucusu ile bağlantı kuruldu ";
}else
{echo "hata"; mysql_error();}
@mysql_select_db($veritabani,$baglanti)
or die("veritabanına baglanılmadı");
?>
-----------------------
form.php
<html>
<body>
<form action="baglanti.php" method="post" name="form1">
no < input type="text" name="b1">
ad < input type="text" name="b2">
soyad < input type="text" name="b3">
< input type="submit" name="kaydet">
</body>
</html>
----------------------------------------------------------------------
baglanti.php
<?
include("ayar.php");
$sor=mysql_query("select*from ogrenci");
while($cek=mysql_fetch_array($sor))
{
$no=$cek["no"];
$ad=$cek["ad"];
$soyad=$cek["soyad"];
?>
<table border="0" bordercolor="blue">
<tr><td>no</tr><td><?echo $no ?> </td> </tr>
<tr><td>ad</tr><td><?echo $ad ?> </td> </tr>
<tr><td>soyad</tr><td><?echo $soyad ?> </td> </tr>
</table>
<br/>
<?
}
?>
|