Rhawn Posted January 24, 2007 Share Posted January 24, 2007 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.phpini_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] Quote Link to comment https://forums.phpfreaks.com/topic/35458-simple-php-sql-question/ Share on other sites More sharing options...
artacus Posted January 24, 2007 Share Posted January 24, 2007 1) make sure your web server is handling php correctly2) change dbc$ to $dbc Quote Link to comment https://forums.phpfreaks.com/topic/35458-simple-php-sql-question/#findComment-167861 Share on other sites More sharing options...
Rhawn Posted January 24, 2007 Author Share Posted January 24, 2007 #2 was it, thanks a bunch artacus. Quote Link to comment https://forums.phpfreaks.com/topic/35458-simple-php-sql-question/#findComment-168029 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.