Hi everyone,
I´m creating a database where my colleagues and I can put in our plans for the nextcoming weeks.
I´ve made the script which inserts the data to the database so this far I´m all good.
However, I just can’t get the output data right!
This is how my database table is set up:
Here is the output I want:
And here’s my current script:
[php]mysql_connect(“localhost”, “username”, “password”) or die (“Error , check your server connection.”);
mysql_select_db(“database”);
$query = “SELECT B.Week, A.display_name, B.WhatsPlanned, A.avatar FROM logins_users A, trainingplanner B WHERE A.id = B.UserID order by week desc”;
$result = mysql_query($query) or die (mysql_error());
if (mysql_num_rows($result)!=0) {
echo “
Week | Name | Planned |
[/php]
MANY thanks in advance!