Also, doing this under Windows XP off of IIS 6x.
Here is the basic code:
Code: Select all
<?php
// Connecting, selecting database
$link = mysql_connect('127.0.0.1', 'root', 'password')
or die('Could not connect: ' . mysql_error());
echo 'Connected successfully';
mysql_select_db('test') or die('Could not select database');
// Performing SQL query
$query = 'SELECT * FROM news';
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
// Printing results in HTML
echo "<table>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "\t<tr>\n";
foreach ($line as $col_value) {
echo "\t\t<td>$col_value</td>\n";
}
echo "\t</tr>\n";
}
echo "</table>\n";
// Free resultset
mysql_free_result($result);
// Closing connection
mysql_close($link);
?>Whats the new structure look like? that was basically copied from the php.net site, and I havent been successful when doing searches for MySQL 5x + PHP specific coding.
Need to convert my old scripts.