$table = "<table>\n";
            for ($i = 0; $i < sizeof($rounds); $i++) {

    $table .= "<tr><th>Week #: " . ($i + 1) . "</th><th>Match</th><th>Away</th><th>Referee</th></tr>\n";//table headers

     foreach ($rounds[$i] as $r   ) {//iterate through an array

$table .= "<tr> <td> Day :</td> <td> $r   </td> <td>".$r["Away"]."</td><td>   </td></tr>\n";
    //i want to store values of this table in a database table


Recommended Answers

All 2 Replies

hi guys, u can use phpmyadmin

So.. the problem is your question is very vague. Instead, I will walk you through how to find your answer on your own and hopefully that will help you.

First, you need to understand the basics of how HTML/Form Data work. You can find that here:
--Alternatively, if you don't want to do it as a form post and would like to do it as AJAX, you can instead look here:

In either case, you will either wrap your table in a "form" element, and each node of your table will require an input (which holds the value).
If you instead go the AJAX route, you will need to iterate the cells of your table, and create your AJAX parameters through script.
(need help iterating through table cells? try this: https://stackoverflow.com/questions/3065342/how-do-i-iterate-through-table-rows-and-cells-in-javascript)

From there, you send your data off to your server, which requires PHP (which seems to be what you are using to make your table). I will make the assumption that you know the basics based on your code: however, the things you are going to be most interested in with form data / ajax data are:
-- Particularly, GET or POST depending on how you decide to send your request (likely a POST, as you want to "save" data, which is the intended use).

From there you will need to use PHP to take the incoming values and use MySQL to save the data in your database.
You can read all about that here:

It should cover just about everything you need to get up and running.

Lastly, and the most important bit, use google. Before asking others ask yourself "given the problem I am trying to solve, what do I know how to do?" With that information, start with what you know - then figure out how to solve the things you don't. When you come to a point where google cannot answer your questions, and you do not know the process yourself and can't visualize, then come post some code and we can help with more concrete problem solving to specific issues you are having.

In short: I googled that for you. If you wan't to program, the most important thing to do is learn to think like a programmer - and it's simple: "What do I know how to do? (do it) If I don't know, do I know where to look to find how to do it? (look it up, then do it) If not, ask for help from other developers." (make us all feel silly because we don't know either :-/ )

Good luck,


commented: Heh heh, sponsored by w3s are we? +2
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.