kemper Posted January 15, 2007 Share Posted January 15, 2007 I am hosting a sports website and am processing schedules for the particpating clubs to assign times and field assignments. An example table is as follows:[table] [tr] [td][b]Club[/b][/td] [td][b]Age[/b][/td] [td][b]Date[/b][/td] [td][b]Time/Notes[/b][/td] [td][b]Time[/b][/td] [td][b]Home[/b][/td] [td][b]Visitors[/b][/td] [td][b]Field[/b][/td] [/tr] [tr] [td]Club 1[/td] [td][center]7[/center][/td] [td]04/21/07[/td] [td] [/td] [td] [/td] [td]Team 1[/td] [td]Team 2[/td] [td] [/td] [/tr] [tr] [td]Club 2[/td] [td][center]9[/center][/td] [td]04/21/07[/td] [td]after 1pm[/td] [td] [/td] [td]Team 3[/td] [td]Team 2[/td] [td] [/td] [/tr] [tr] [td]Club 2[/td] [td][center]8[/center][/td] [td]04/28/07[/td] [td] [/td] [td] [/td] [td]Team 2[/td] [td]Team 1[/td] [td] [/td] [/tr] [tr] [td]Club 1[/td] [td][center]7[/center][/td] [td]05/05/07[/td] [td] [/td] [td] [/td] [td]Team 1[/td] [td]Team 3[/td] [td] [/td] [/tr] [tr] [td]Club 3[/td] [td][center]8[/center][/td] [td]05/05/07[/td] [td]before 3pm[/td] [td] [/td] [td]Team 3 [/td] [td]Team 1[/td] [td] [/td] [/tr] [tr] [td]Club 3[/td] [td][center]9[/center][/td] [td]05/05/07[/td] [td] [/td] [td] [/td] [td]Team 3[/td] [td]Team 5[/td] [td] [/td] [/tr][/table][color=blue][i]What I want to do allow schedules from each club to see and edit their own specific schedules (eq. Club 1 would display only their own rows and be able to input times into "Time" column and specific field assignments into "Field" column).[/i][/color]I am not exactly sure where to start. I have the complete schedule with 30 different clubs and 12 different ages in a MySQL database table already.Assistance is greatly appreciated. Link to comment https://forums.phpfreaks.com/topic/34284-allow-members-ability-to-display-and-edit-specific-info-in-mysql-table/ Share on other sites More sharing options...
micah1701 Posted January 15, 2007 Share Posted January 15, 2007 that is a fairly easy project but it has a few steps that need to be implemented first so its a little hard to help you without knowing what you already have accomplished.First, you need a member database that lets people log in; Do you have that? If not, thats where you need to start. Link to comment https://forums.phpfreaks.com/topic/34284-allow-members-ability-to-display-and-edit-specific-info-in-mysql-table/#findComment-161252 Share on other sites More sharing options...
kemper Posted January 15, 2007 Author Share Posted January 15, 2007 Site, membership, database already setup. This has been in the works for years now. Link to comment https://forums.phpfreaks.com/topic/34284-allow-members-ability-to-display-and-edit-specific-info-in-mysql-table/#findComment-161281 Share on other sites More sharing options...
kemper Posted January 16, 2007 Author Share Posted January 16, 2007 Each Club Scheduler has already been assigned to the specific club, so I do not need the precursor "Club" select and submit.Let's say I log in and only want to see and edit only "Club 2". How can I write the script to display and allow editting to only "Club 2"? Link to comment https://forums.phpfreaks.com/topic/34284-allow-members-ability-to-display-and-edit-specific-info-in-mysql-table/#findComment-161952 Share on other sites More sharing options...
kemper Posted January 16, 2007 Author Share Posted January 16, 2007 [color=blue]Basically, I want a form to appear (if "Club 2" scheduler was logged in) similar to :[/color][img]http://www.daswebhaus.com/images/tableform.jpg[/img] Link to comment https://forums.phpfreaks.com/topic/34284-allow-members-ability-to-display-and-edit-specific-info-in-mysql-table/#findComment-162399 Share on other sites More sharing options...
GingerRobot Posted January 16, 2007 Share Posted January 16, 2007 Do you not just select and display results where the club field equals club 2? Link to comment https://forums.phpfreaks.com/topic/34284-allow-members-ability-to-display-and-edit-specific-info-in-mysql-table/#findComment-162405 Share on other sites More sharing options...
kemper Posted January 16, 2007 Author Share Posted January 16, 2007 I was told to use a script like:[code]<?phpinclude("config.inc.php");if ($db == 1) {echo "<center><font face='Arial' size='4' color='#000000'><b>Results:</b></font></center><br><br>\n\n";}if($db==1) {// mySQL Table$db_con = mysql_connect(MyHost, MyUsername, MyPassword) or die("Connetion to database failed!");mysql_select_db(MyDatabase);$query="SELECT * FROM test where MyTable =". $_POST['Club 1']."";$result=mysql_query($query);while ($row = mysql_fetch_assoc($res)) {## format it by table, paragraph or div, whatever format$row['field_scheduler']$row['division']$row['time']$row['date']$row['time_notes']$row['time']$row['home_team']$row['visitor_team']$row['home_field']echo '<a href="editpage.php?id='.$row[id].'">EDIT</a>';echo '<a href="deletepage.php?id='.$row[id].'">DELETE</a>'} ?>[/code]This gave me error:Parse error: syntax error, unexpected T_VARIABLE in /home/kemper/public_html/mysite/schedules.php on line 18 Link to comment https://forums.phpfreaks.com/topic/34284-allow-members-ability-to-display-and-edit-specific-info-in-mysql-table/#findComment-162408 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.