Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 27852

how to work with mysql on iis 7

$
0
0

hello i am a newbie and working on iis 7

php is working on my iis 7. the problem is that i am creating my very first blog using php and my sql

this is the code and it is php file

<?php
mysql_connect("localhost", "root", "####");
mysql_select_db("mainblog");
?> <?php
$sql = mysql_query("SELECT * FROM blogdata ORDER BY id DESC");
while($row = mysql_fetch_array($sql)) {
$title = $row['title']}
$content = $row['content'];
$category = $row['category'];
?>
<html>
<head>
<title>blog</title>

</head>

<body>
Here is my blog<hr>

<table border="1">
<tr><td><?php echo $title; ?></td><td><?php echo $category; ?></td></tr>
<tr><td colspan="2"><?php echo $content; ?></td></tr>
</table>
<?php

?>

</body>
</html>

when i open with local host e.g localhost/blog.php 

it shows a message "cannot connect to server" http error 500 

when i remove all the sql codes from the above

it works and shows the blog page

PHPMYADMIN is also working on iis 7 

please figure out the problem


Viewing all articles
Browse latest Browse all 27852

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>