Link to home
Start Free TrialLog in
Avatar of DBDevOne
DBDevOne

asked on

Get data from MySQL to fill in data in a webpage

Hello. I am going to create a webpage that gets data from a MySQL table on a Linux server to populate a table in a webpage.

How would I go about doing that?

Avatar of Codeit1978
Codeit1978

First What scripting language is your page in?
Avatar of DBDevOne

ASKER

The language doesn't matter. I'm open for suggestions.
php is the most widely used scripting language on the linux platform for creating dynamic webpage. It is really straightforward as well. It is also platform independant, therefore you can even make it work on windows.
Check out http://www.php.net
ASKER CERTIFIED SOLUTION
Avatar of Jankit141180
Jankit141180

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hello

One more thing in concern with my previous post  ....

I have not included any HTML formatiing in my script.
The script will print only first column on the browserand accordingly you are requested to do formatting.

Thank You
-Jankit
This example is a php example ( with mysql ).
This is a bit shorter and perfect for writing your first databasedriven script ( in the future it is beter to exclude the first part and put in an other file , so it is better to make updates f.e. username , otherwis you have to change it on each page - for this use include)

$hostname_db = "server";
$database_db = "databasename";
$username_db = "username";
$password_db = "pwd1";
$db = mysql_pconnect($hostname_db, $username_db, $password_db) or trigger_error(mysql_error(),E_USER_ERROR);

mysql_select_db($database_db, $db);
$query_producten = "SELECT * FROM producten ";
$producten = mysql_query($query_producten, $db) or die(mysql_error());
$row_producten = mysql_fetch_assoc($producten);

do{
   echo($row_producten['field']);
} while ($row_producten = mysql_fetch_assoc($producten));

Greetz Ultimat
Thank you very much Jankit and thank you all for the comments. I appreciate it!