php ile mysql'e nasıl bağlanılır?
gönderen: turgut | kategori: php | tarih: 20.6.09
en basit şekliyle php ile mysql'e bağlantı aşağıdaki kodlarla yapılır:
<html>
<head>
<meta http-equiv="Content-Language" content="tr">
<meta http-equiv="Content-Type" content="text/html charset=windows-1254">
<title> MySql Bağlantısı </title>
</head>
<body>
<?php
$databasebaglantisi=mysql_connect("localhost","root","sifre");
if (!$databasebaglantisi){
echo "MySQL'e bağlanılamadı";
}
else{
echo "MySQL'e bağlanıldı";
}
?>
</body>
</html>
This entry was posted on 20.6.09 at 18:20 and is filed under php. You can follow any responses to this entry through the RSS 2.0. You can leave a response.








# > ufuk - 24.06.2009 20:08
Buda benden olsun ;
veritabanina bağlanti kurmak icin
@mysql_select_db ("veritabani_ismi") or die ("veritabanına bağlantı kurulamadı");