hi friends....
i m new to php....

i have installed apachie 2.0,php 5.2,mysql5.1...
everything is going welll....
bt dere is problem using d following code,,

<php
mysql_connect("localhost", "root", "mars11") or die(mysql_error());
echo "Connected to MySQL<br />";
</php>

i hv save it in the htdocs folder under apachie...filename is test.php
bt when i run it nothing is displayed...
wats going on pls solve my problem....

Recommended Answers

All 2 Replies

For starters, <php is not a valid delimiter. Use <?php to start the code and ?> to end it. Is Apache and php configured correctly? Have you tried a simple <?php echo "It works.";?> type script to test the server?

yes... php,apachie and mysql are configured correctly...

yes scripts are running.............
everything is going well..
i hv also tried
<?php
>?
bt again d proble is same while running dis script.

<?php
mysql_connect("localhost", "root", "mars11") or die(mysql_error());
echo "Connected to MySQL<br />";
>?

wat should i do???

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.