Personally I find the mysql_fetch_array function to be a little easier. It takes the results from a mysql query and puts them into an array which can the be accessed by using the column name as the array index.
example $myrow['username']
you could try something like this to print the information from a database
Code: Select all
$result = mysql_query ("SELECT * FROM table", $db);
while ($myrow = mysql_fetch_array($result)) {
printf("Company name: %s <br />", $myrowї'company_name']);
}
The above code would print out "Company name: name from database" for each row in the database, so if you had 5 rows it would print five times with the Company name being the company name columen from that row in the database table.
In you're code, you're missing a comma between \n" and mysql_result ...
seperating the string from the variables, and I would suggest using printf rather then print.
Good luck[/i]