Page 2 of 2

Re: creating an tab

Posted: Tue Sep 21, 2010 10:34 am
by Jonah Bron
jhaustein wrote:... but i don“t know how to change the php code...
Post what you have.

Re: creating an tab

Posted: Tue Sep 21, 2010 11:11 am
by jhaustein
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>

Re: creating an tab

Posted: Tue Sep 21, 2010 3:22 pm
by Jonah Bron
Are you asking just how to get the availability of all members and display it?

Re: creating an tab

Posted: Wed Sep 22, 2010 1:34 am
by jhaustein
hi jonah

yes the availability with checkboxes in the table

and the possibilty for the members to change the status of the checkboxes

Re: creating an tab

Posted: Wed Sep 22, 2010 7:27 pm
by Jonah Bron
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

Posted: Wed Sep 22, 2010 11:54 pm
by jhaustein
Hi jonah
THx for your help but i don't Know Code for this Task

Sorry

Re: creating an tab

Posted: Thu Sep 23, 2010 11:35 am
by Jonah Bron
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.