digicrime
11-03-2007, 01:44 PM
Rather new to php so I'm trying to learn how to print out some results. The column I want to query has 24,113 rows so it has a lot of data but I want to sort it via a specific field so Im trying this. Sorting I know ASC DSC but I will learn how to do this another way just want to get past the basic part.
<?
$dbhost = 'localhost';
$dbuser = 'zackman_;
$dbpass = '1083';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
$dbname = 'zackman_';
mysql_select_db($dbname);
$data = mysql_query("SELECT * FROM userfield ORDER BY field55 LIMIT 0,20;") or die(mysql_error());
echo "$data";
mysql_close($conn);
?>
Problem is I am getting a Resource ID 3 error which I am not familar with. I realize there is a lot of data to print so I want to learn how to to format it to look a little more nicer when it is viewed on the web which Ill figure out eventually but I can't get past this part. I have MySQL5 and apache2/php5 this is my own server so I can configure it any way I like in the event the problem is more then just a coding/syntax error
<?
$dbhost = 'localhost';
$dbuser = 'zackman_;
$dbpass = '1083';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
$dbname = 'zackman_';
mysql_select_db($dbname);
$data = mysql_query("SELECT * FROM userfield ORDER BY field55 LIMIT 0,20;") or die(mysql_error());
echo "$data";
mysql_close($conn);
?>
Problem is I am getting a Resource ID 3 error which I am not familar with. I realize there is a lot of data to print so I want to learn how to to format it to look a little more nicer when it is viewed on the web which Ill figure out eventually but I can't get past this part. I have MySQL5 and apache2/php5 this is my own server so I can configure it any way I like in the event the problem is more then just a coding/syntax error