begginers question
Posted: Wed Jan 21, 2009 12:19 am
Hi all, I am trying to display the results of a SQL query and for some reason nothing is being returned, this is driving me nuts but as I am fairly new to PHP im sure its something simple
here is my code, I hve omitted the username and password but I know that they are correct.
here is my code, I hve omitted the username and password but I know that they are correct.
Code: Select all
<?php
$Host="localhost";
$Username="";
$Password="";
$DBName="welladorned";
$TableName="Simplified Spreadsheet";
$link = mysql_connect ($Host, $Username, $Password) or die('Could not connect: ' . mysql_error());
mysql_select_db($DBName) or die('Could not select database');
$query="SELECT `Product Code` FROM `Simplified Spreadsheet' GROUP BY `Product Code` ORDER BY `Product Code` LIMIT 0 , 30";
$result=mysql_query($query);
if (!result){
die ("Could not query the database: <br />". mysql_error());
}
array mysql_fetch_row ( resource $result);
mysql_close();
?>