Jump to content

Using PHP to place information database into table


damju87
 Share

Recommended Posts

I'm trying to save a lot of time instead of editing the page everytime. Wouldn't it be easier to just change the information in the database, right? I've been searching for days on how to do it but having no luck. I will be very grateful for the help. Thank you.

<table id="data">  <tr>	<th scope="row">Occupation</th>	<td>Singer</td>  </tr>  <tr>	<th scope="row">Debut</th>	<td>December 02, 2011</td>  </tr>  <tr>	<th scope="row">Data of Birth</th>	<td>February 13, 1990</td>  </tr>  <tr>	<th scope="row">Record Label</th>	<td>Ttakttaguri Entertainment</td>  </tr>  <tr>	<th scope="row">Links</th>	<td><a href="http://d2kr.com/hboard3/" target="_blank">Official</a>,	<a href="http://blog.naver.com/agia0213">Naver Blog</a>,	<a href="https://twitter.com/#!/agia0213">Twitter</a>,	<a href="http://me2day.net/agia0213" target="_blank">Me2day</a></td>  </tr></table>

Link to comment
Share on other sites

Yes. Using a database is faster. Because you didn't mention what you have tried I'm going to be general. If you're gonna edit values in the database directly, then all you need to do is setup a database and a table with the columns that you need. A very popular database is MySQL, and a very popular database manager is phpMyAdmin, both are free. You can setup and manage your database with phpMyAdmin if you have it. More than likely your webhost (if you have one) will have phpMyAdmin database manager together with a MySQL database, just look for the link.

Link to comment
Share on other sites

you will need to acces database and fetch the data and put it in html table dynamicaly. you can start over here http://w3schools.com/php/php_mysql_intro.asp

Link to comment
Share on other sites

$result = mysql_query("SELECT * FROM djuinfosolo WHERE engname='Agia'");while($row = mysql_fetch_array($result))  {  echo $row['engname'] . " " . $row['dateofbirth'];  echo "<br />";  }mysql_close($con);// some code?>

This is what I have but I'm trying to get it to grab one row without looping. How do I get it where ['engname'] = $engname? So that I will be able to place $engname in a table.

Link to comment
Share on other sites

So after this:

$result = mysql_query("SELECT * FROM djuinfosolo WHERE engname='A.Y'");mysql_close($con);// some code

Do I...

<? echo ['engname'] ?>

When I want to only display one field?

Link to comment
Share on other sites

No. Like this:

$result = mysql_query("SELECT * FROM djuinfosolo WHERE engname='A.Y'");$row = mysql_fetch_array($result);echo $row['engname'];

  • Like 1
Link to comment
Share on other sites

No. Like this:
$result = mysql_query("SELECT * FROM djuinfosolo WHERE engname='A.Y'");$row = mysql_fetch_array($result);echo $row['engname'];

Thanks a lot! It worked! And thanks everybody else who helped me.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...