Hello everyone,
I am very new for PHP. I want to writing database connection and listing. My SQL server name is Heat and my table name is Profile. So, I am sending my code. If you see any mistake in my code, please to warn me and help me.
Regards
Tanju
<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->
<?
$baglanti = mysql_connect("Heat");
$strSQL = "Select * from Profile";
$sonuc = mysql_db_query("HEAT",$strSQL,$baglanti);
?>
<head>
<title> MySQL - PHP Uygulamalari </title>
</head>
<body bgcolor="white" marginheight="0" marginwidth="0">
<table border="0" cellpadding="0" cellspacing="1"
bgcolor="orange">
<tr>
<th>Isim</th><th>Ev Tel. </th><th>E-Mail </th>
</tr>
<?
while ($satir = mysql_fetch_array($sonuc)):
?>
<tr>
<td><? echo $satir[Name] ?></td>
<td><? echo $satir[Phone] ?></td>
<td><? echo $satir[EMailID] ?></td>
</tr>
<? endwhile ?>
</table>
</body>
when I run this code, I received this error message;
Warning: MySQL Connection Failed: Can't connect to MySQL server on 'Heat' (10061) in d:\program files\apache group\apache\htdocs\db_ornek_1.php on line 4
Warning: Supplied argument is not a valid MySQL-Link resource in d:\program files\apache group\apache\htdocs\db_ornek_1.php on line 8
Isim Ev Tel. E-Mail
Warning: Supplied argument is not a valid MySQL result resource in d:\program files\apache group\apache\htdocs\db_ornek_1.php on line 25
I am very new for PHP. I want to writing database connection and listing. My SQL server name is Heat and my table name is Profile. So, I am sending my code. If you see any mistake in my code, please to warn me and help me.
Regards
Tanju
<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->
<?
$baglanti = mysql_connect("Heat");
$strSQL = "Select * from Profile";
$sonuc = mysql_db_query("HEAT",$strSQL,$baglanti);
?>
<head>
<title> MySQL - PHP Uygulamalari </title>
</head>
<body bgcolor="white" marginheight="0" marginwidth="0">
<table border="0" cellpadding="0" cellspacing="1"
bgcolor="orange">
<tr>
<th>Isim</th><th>Ev Tel. </th><th>E-Mail </th>
</tr>
<?
while ($satir = mysql_fetch_array($sonuc)):
?>
<tr>
<td><? echo $satir[Name] ?></td>
<td><? echo $satir[Phone] ?></td>
<td><? echo $satir[EMailID] ?></td>
</tr>
<? endwhile ?>
</table>
</body>
when I run this code, I received this error message;
Warning: MySQL Connection Failed: Can't connect to MySQL server on 'Heat' (10061) in d:\program files\apache group\apache\htdocs\db_ornek_1.php on line 4
Warning: Supplied argument is not a valid MySQL-Link resource in d:\program files\apache group\apache\htdocs\db_ornek_1.php on line 8
Isim Ev Tel. E-Mail
Warning: Supplied argument is not a valid MySQL result resource in d:\program files\apache group\apache\htdocs\db_ornek_1.php on line 25