creating an tab
Moderator: General Moderators
creating an tab
hi
i have two tables in my mysql db
1. members
2. dates
now i will create an table so that i´ve in the top row the dates from the mysql tab and in the first column the members
in the tab should be checkboxes so that a member can check the checkboxes if he has time or not
should be an attendance list
i don´t know how i can create such kind of table
i have two tables in my mysql db
1. members
2. dates
now i will create an table so that i´ve in the top row the dates from the mysql tab and in the first column the members
in the tab should be checkboxes so that a member can check the checkboxes if he has time or not
should be an attendance list
i don´t know how i can create such kind of table
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: creating an tab
Your question is unintelligible. Could you try to explain it again?
Re: creating an tab
sorry
i have the following entries in my mysql db tab
member
id___name
1_peter
2_paul
3_mary
and in the tab dates
id___date
1___12.03.2010
2___23.04.2010
3___12.05.2010
now i will have the following output tab
________12.03.2010________23.04.2010_______12.05.2010
peter____checkbox_________checkbox__________checkbox
paul_____checkbox_________checkbox__________checkbox
mary____checkbox_________checkbox__________checkbox
now want to have the this tab with the checkboxes where i can check the checkboxes
i have the following entries in my mysql db tab
member
id___name
1_peter
2_paul
3_mary
and in the tab dates
id___date
1___12.03.2010
2___23.04.2010
3___12.05.2010
now i will have the following output tab
________12.03.2010________23.04.2010_______12.05.2010
peter____checkbox_________checkbox__________checkbox
paul_____checkbox_________checkbox__________checkbox
mary____checkbox_________checkbox__________checkbox
now want to have the this tab with the checkboxes where i can check the checkboxes
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: creating an tab
Code: Select all
<table>
<tr>
<td></td>
<?php
$mysql = mysql_connect(/* your mysql info here */);
$query = mysql_query('SELECT * FROM dates', $mysql);
$count = 0;
while ($row = mysql_fetch_assoc($query)) {
echo '<td>' . $row['date'] . '</td>';
$count += 1;
}
?>
</tr>
<?php
$query = mysql_query('SELECT * FROM members', $mysql);
while ($row = mysql_fetch_assoc($query)) {
echo '<tr>' . PHP_EOL . '<td>' . $row['name'] . '</td>' . PHP_EOL;
for ($i = 0; $i < $count; $i++) {
echo '<td><input type="checkbox" name="checkbox[]" value="???" /></td>' . PHP_EOL;
}
echo '</tr>' . PHP_EOL;
}
?></table>Re: creating an tab
hi
many thx
can you describe me how i can get the info´s of the checkboxes in my mysql tab
many thx
can you describe me how i can get the info´s of the checkboxes in my mysql tab
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: creating an tab
If you put what I gave you into a form (with method "post"), just loop through $_POST['checkbox'] on the target page.
Code: Select all
if (!isset($_POST['checkbox'])) {
die();
}
foreach ($_POST['checkbox'] as $checkbox) {
// do something with $checkbox.
}Re: creating an tab
sorry i don´t understand
first i need another mysql tab or?
for example
memberscheck
id_____id_member__________id_dates_______check
or how can i manage it
first i need another mysql tab or?
for example
memberscheck
id_____id_member__________id_dates_______check
or how can i manage it
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: creating an tab
I really don't understand what you're trying to accomplish. Perhaps if you could explain what you're trying to do exactly I'd be able to help you. What is your country of origin?
Re: creating an tab
hi
i want to create an attendance list
so that a member can seethe list a can check the checkboxes of his row - if he i available or not
i want to create an attendance list
so that a member can seethe list a can check the checkboxes of his row - if he i available or not
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: creating an tab
Okay, you need to change your date table to create a many-to-one relationship between the date and the members available.
Read this: http://en.wikipedia.org/wiki/One-to-many
[syntax]available_dates
id member date available
1 1 3-12-10 true
2 4 3-12-10 false
3 2 3-13-10 false
...
[/syntax]
You should make it so that each member can see his/her own checkboxes, not other people's.
Read this: http://en.wikipedia.org/wiki/One-to-many
[syntax]available_dates
id member date available
1 1 3-12-10 true
2 4 3-12-10 false
3 2 3-13-10 false
...
[/syntax]
You should make it so that each member can see his/her own checkboxes, not other people's.
Re: creating an tab
I think it is à Little difficult for me
i can create the new mysql tab with the datas you gave me - but i don´t know how to change the php code so that i get the datas in my html tab and how i can change it
can you help me more
i can create the new mysql tab with the datas you gave me - but i don´t know how to change the php code so that i get the datas in my html tab and how i can change it
can you help me more
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: creating an tab
Sure, create the table and post what code you have (please surround your code with the [syntax=php][/syntax] tags when posting. You can use the PHP Code button).
Re: creating an tab
now i have create the tab - but i don´t know how i can realize it
sorry
sorry
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: creating an tab
What do you mean you don't know how to "realize" it?
Re: creating an tab
I don't Know the Code for the checkboxes
i really don't Know how to do it
Can you Show me how you ll do that
i really don't Know how to do it
Can you Show me how you ll do that