Jump to content

simple php sql question


Rhawn

Recommended Posts

I am reading a book on php and trying to get a simple php mysql connect script to work.  When I open the page on my web server, which has php, nothing happens, nothing prints.  Anyone have a suggestion?  Thanks in advance.

[code]
<html>
<body>

<?php
//Script 12.1 sql_connect.php
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);

if (dbc$ = mysql_connect ('localhost', 'username', 'password'))
{
print '<p>Success connect</p>';
mysql_close();
}
else {
print '<p>U FAIL</p>';
}
?>
</body>
</html>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/35458-simple-php-sql-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.