Hello, I am trying just a very basic query to retrieve results from the orders table of the DB- I am getting a error when I try to run it.
http://www.logoshop.us/query1.php
the query1.php code is
<?php
require_once ('connection/db_connect.php');
$query = 'SELECT customers_name , customers_street_address , customers_city , customers_postcode , customers_state , customers_telephone , customers_email_address , date_purchased '
. ' FROM orders LIMIT 0, 30';
$result = @ ($query);
if ($result) {
echo '<table align="center" cellpadding="2" cellspacing="2">
<tr>
<td align="left"><b>1</b></td>
<td align="left">>b>2</b></td>
<td align="left">>b>3</b></td>
<td align="left">>b>4</b></td>
<td align="left">>b>5</b></td>
<td align="left">>b>6</b></td>
<td align="left">>b>7</b></td>
<td align="left">>b>8</b></td>
</tr>
';
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
echo
"<tr>
<td align=\"left\">$row[0]</td>
<td align=\"left\">$row[1]</td>
<td align=\"left\">$row[2]</td>
<td align=\"left\">$row[3]</td>
<td align=\"left\">$row[4]</td>
<td align=\"left\">$row[5]</td>
<td align=\"left\">$row[6]</td>
<td align=\"left\">$row[7]</td>
</tr>\n";
}
echo '</table>';
mysql_free_result ($result);
} else {
echo '<p>these fields could not be displayed due to a system error</p><p>' . mysql_error() . '</p>';
}
mysql_close();
?>
------- The Error Is---------
these fields could not be displayed due to a system error
No Database Selected
The - db_connect.php file is
<?php
define('DB_SERVER', 'localhost');
define('DB_SERVER_USERNAME', '******');
define('DB_SERVER_PASSWORD', '******');
define('DB_DATABASE', 'logoshop_us-oscommerce');
?>
any help would be greatly appreciated!