Code: Select all
<?php
/* Connecting, selecting database */
print "attempting to commect to database";
$link = mysql_connect("localhost:3306", "root", "m@st0lf")
or die("Could not connect");
print "Connected successfully";
mysql_select_db("mysql") or die("Could not select database");
/* Performing SQL query */
$query = "SELECT * FROM mysql";
$result = mysql_query($query) or die("Query failed");
/* Printing results in HTML */
print "<table>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
print "\t<tr>\n";
foreach ($line as $col_value) {
print "\t\t<td>$col_value</td>\n";
}
print "\t</tr>\n";
}
print "</table>\n";
/* Free resultset */
mysql_free_result($result);
/* Closing connection */
mysql_close($link);
?>-------------------------------------------------------------------------------
Here's the response I get ..
attempting to commect to database
Warning: Can't create TCP/IP socket (10106) in c:\orion\default-web-app\forums\testsql.php on line 7
Warning: MySQL Connection Failed: Can't create TCP/IP socket (10106) in c:\orion\default-web-app\forums\testsql.php on line 7
Could not connect
------------------------------------------------------------------------------
Any insight or assistance would be most appreciative. I'm sort of at my end on this one.
Thanks.