Post what you have.jhaustein wrote:... but i don´t know how to change the php code...
creating an tab
Moderator: General Moderators
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: creating an tab
Re: creating an tab
only this code
<table>
<tr>
<td></td>
<?php
$mysql = mysql_connect('localhost', 'root', '');
mysql_select_db("test");
$query = mysql_query('SELECT * FROM dates', $mysql);
echo mysql_errno() . ": " . mysql_error(). "\n";
$count = 0;
while ($row = mysql_fetch_assoc($query)) {
echo '<td>' . $row['datum'] . '</td>';
$count += 1;
}
?>
</tr>
<?php
$query = mysql_query('SELECT * FROM member', $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>
<table>
<tr>
<td></td>
<?php
$mysql = mysql_connect('localhost', 'root', '');
mysql_select_db("test");
$query = mysql_query('SELECT * FROM dates', $mysql);
echo mysql_errno() . ": " . mysql_error(). "\n";
$count = 0;
while ($row = mysql_fetch_assoc($query)) {
echo '<td>' . $row['datum'] . '</td>';
$count += 1;
}
?>
</tr>
<?php
$query = mysql_query('SELECT * FROM member', $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>
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: creating an tab
Are you asking just how to get the availability of all members and display it?
Re: creating an tab
hi jonah
yes the availability with checkboxes in the table
and the possibilty for the members to change the status of the checkboxes
yes the availability with checkboxes in the table
and the possibilty for the members to change the status of the checkboxes
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: creating an tab
To view the availability, use the code above. Populate the table you made with some fake info just to fill it up. Then, as you loop through the dates, do another loop inside of that looping through members. If that member is available on that date, put ' checked=""' into the checkbox. If not, then don't.
Re: creating an tab
Hi jonah
THx for your help but i don't Know Code for this Task
Sorry
THx for your help but i don't Know Code for this Task
Sorry
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: creating an tab
You don't have to know the code. Almost everything I do on my own projects I've never done before. You just try to work through the logic and start typing.