Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.
Consider it done.
$link = mysql_connect('localhost', 'root@localhost', '*******')or die('Could not connect: ' . mysql_error());
Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'localhost' (10061) in C:\Program Files\Apache Group\Apache2\htdocs\test.php on line 9Could not connect: Can't connect to MySQL server on 'localhost' (10061)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>Untitled</title></head><body><?php$link = mysql_connect('localhost', 'root@localhost', '******')or die('Could not connect: ' . mysql_error());?><p>Connected successfully</p><?phpmysql_select_db('inventory') or die('Could not select database');$query = 'SELECT * FROM items';$result = mysql_query($query) or die('Query failed: ' . mysql_error());?><table><?phpwhile ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {?> <tr><?php foreach ($line as $col_value) {?> <td><?php echo ($col_value != '' ? $col_value : ' '); ?></td><?php }?> <tr><?php}?></table><?phpmysql_free_result($result);mysql_close($link);?> </body></html>
$link = mysql_connect('localhost', 'root', '********') or die ('Could not connect: ' . mysql_error());
do bear with me if I appear to be blind or stupid...