kemper Posted February 7, 2007 Share Posted February 7, 2007 I have a table within MySQL Database that I would like edittable. How would I make this possible? Quote Link to comment https://forums.phpfreaks.com/topic/37485-solved-display-table-data-and-make-edittable/ Share on other sites More sharing options...
Balmung-San Posted February 7, 2007 Share Posted February 7, 2007 What? By default MySQL tables are editable, except the tables that MySQL itself uses. In which case no user except the main MySQL user has access to them. Are you sure the user you're using has permissions to edit that table? Quote Link to comment https://forums.phpfreaks.com/topic/37485-solved-display-table-data-and-make-edittable/#findComment-179281 Share on other sites More sharing options...
kemper Posted February 7, 2007 Author Share Posted February 7, 2007 I have created my table that is not associated with my CMS. It is a schedule that I would like two fields edittable bymy users. Assistance is appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/37485-solved-display-table-data-and-make-edittable/#findComment-179285 Share on other sites More sharing options...
Balmung-San Posted February 7, 2007 Share Posted February 7, 2007 You would have them edit it via a form. Then take the post data in, and do an UPDATE on the MySQL table. Quote Link to comment https://forums.phpfreaks.com/topic/37485-solved-display-table-data-and-make-edittable/#findComment-179288 Share on other sites More sharing options...
kemper Posted February 7, 2007 Author Share Posted February 7, 2007 I know how to display the data, but not to have the fill in fields for the two cells that my schedules will edit. I created that screenshot manually. How do I write the script to include edittable text fields under "Time" and "Field"? I was once told to add: echo '<a href="editpage.php?id='.$row[id].'">EDIT</a>'; echo '<a href="deletepage.php?id='.$row[id].'">DELETE</a>' But I do not want each line editted individually. This would take forever for my schedulers to edit their schedules. I have 1500 games to be editted, and some clubs have to edit for >150 games each. This is what I have to display the requested information: <?php require_once "maincore.php"; require_once "subheader.php"; require_once "side_left.php"; if (isset($readmore) && !isNum($readmore)) fallback(FUSION_SELF); opentable("Team Contacts"); // mySQL Table $db_con = mysql_connect(MyHost, MyUsername, MyPassword) or die("Connetion to database failed!"); mysql_select_db(MyDatabase); $age = $_GET['club']; $sql = "SELECT club, age, date, time_notes, time, cemail, home, visitors, field FROM MyTable WHERE club='$club'"; $result = mysql_query($sql) or die(mysql_error()); $i = 0; echo "<font face='Arial' size='4' color='#000000'><b>Team contacts for all divisions of $age:</b></font><p style='margin-top: 0'> <font face='Arial' size='3'>To update your team's contact listing, <u> <font color='#0000ff'><a href='http://www.myrsl.org/viewpage.php?page_id=43'> <font color='#0000cc'>click here<br></font></a></font></u></font><br><br>\n\n"; echo "</p> <table width='100%' border='1' cellspacing='0' cellpadding='5' bordercolorlight='#000000' bordercolordark='#000000'><tr> <th align='left' bgcolor='#FF0000' style='border-style: solid; border-width: 1px' bordercolor='#000000' bordercolorlight='#ff0000' bordercolordark='#000000'> <font face='Arial' color='#FFFFFF' size='2'>Club</font></th> <th align='left' bgcolor='#FF0000' style='border-style: solid; border-width: 1px' bordercolor='#000000' bordercolorlight='#ff0000' bordercolordark='#000000'> <font face='Arial' color='#FFFFFF' size='2'>Age</font></th> <th align='left' bgcolor='#FF0000' style='border-style: solid; border-width: 1px' bordercolor='#000000' bordercolorlight='#ff0000' bordercolordark='#000000'> <font face='Arial' color='#FFFFFF' size='2'>Date</font></th> <th align='left' bgcolor='#FF0000' style='border-style: solid; border-width: 1px' bordercolor='#000000' bordercolorlight='#ff0000' bordercolordark='#000000'> <font face='Arial' color='#FFFFFF' size='2'>Time/Notes</font></th> <th align='left' bgcolor='#FF0000' style='border-style: solid; border-width: 1px' bordercolor='#000000' bordercolorlight='#ff0000' bordercolordark='#000000'> <font face='Arial' color='#FFFFFF' size='2'>Time</font></th> <th align='left' bgcolor='#FF0000' style='border-style: solid; border-width: 1px' bordercolor='#000000' bordercolorlight='#ff0000' bordercolordark='#000000'> <font face='Arial' color='#FFFFFF' size='2'>Home Team</font></th> <th align='left' bgcolor='#FF0000' style='border-style: solid; border-width: 1px' bordercolor='#000000' bordercolorlight='#ff0000' bordercolordark='#000000'> <font face='Arial' color='#FFFFFF' size='2'>Visiting Team</font></th> <th align='left' bgcolor='#FF0000' style='border-style: solid; border-width: 1px' bordercolor='#000000' bordercolorlight='#ff0000' bordercolordark='#000000'> <font face='Arial' color='#FFFFFF' size='2'>Field</font></th> </tr>'; while ($row = mysql_fetch_array($result)) { echo '<tr> <td valign='top' style='border-style: solid; border-width: 1px' bordercolor='#ff0000' bordercolorlight='#ff0000' bordercolordark='#000000'> <font face='Arial' size='1'>' . $row['club'] . "</font></td> <td valign='top' style='border-style: solid; border-width: 1px' bordercolor='#ff0000' bordercolorlight='#ff0000' bordercolordark='#000000'> <p style='margin-top: 0; margin-bottom: 0'><font face='Arial' size='1'>' . $row['age'] . '</font><p style='margin-top: 0; margin-bottom: 0'> <font face='Arial' size='1'> </font><p style='margin-top: 0; margin-bottom: 0'> <font face='Arial' size='1'> </font></td> <td valign='top' style='border-style: solid; border-width: 1px' bordercolor='#ff0000' bordercolorlight='#ff0000' bordercolordark='#000000'> <p style='margin-top: 0; margin-bottom: 0'><font face='Arial' size='1'>' . $row['date'] . '</font></td> <td valign='top' style='border-style: solid; border-width: 1px' bordercolor='#ff0000' bordercolorlight='#ff0000' bordercolordark='#000000'> <p style='margin-top: 0; margin-bottom: 0'><font face='Arial' size='1'>' . $row['time_notes'] . '</font></td> <td valign='top' style='border-style: solid; border-width: 1px' bordercolor='#ff0000' bordercolorlight='#ff0000' bordercolordark='#000000'> <p style='margin-top: 0; margin-bottom: 0'><font face='Arial' size='1'>' . $row['time'] . '</font></td> <td valign='top' style='border-style: solid; border-width: 1px' bordercolor='#ff0000' bordercolorlight='#ff0000' bordercolordark='#000000'> <p style='margin-top: 0; margin-bottom: 0'><font face='Arial' size='1'>" . $row['home'] . "</font></td> <td valign='top' style='border-style: solid; border-width: 1px' bordercolor='#ff0000' bordercolorlight='#ff0000' bordercolordark='#000000'> <p style='margin-top: 0; margin-bottom: 0'><font face='Arial' size='1'>' . $row['visitors'] . '</font></p> </td> <td valign='top' style='border-style: solid; border-width: 1px' bordercolor='#ff0000' bordercolorlight='#ff0000' bordercolordark='#000000'> <p style='margin-top: 0; margin-bottom: 0'><font face='Arial' size='1'>' . $row['field'] . '</font></p> </td> </tr>'; } echo '</table>\n"; // mySQL ends closetable(); require_once "side_right.php"; require_once "footer.php"; ?> Assistance is greatly appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/37485-solved-display-table-data-and-make-edittable/#findComment-179290 Share on other sites More sharing options...
kemper Posted February 9, 2007 Author Share Posted February 9, 2007 Is this request too complicated that no one has any suggestions? Quote Link to comment https://forums.phpfreaks.com/topic/37485-solved-display-table-data-and-make-edittable/#findComment-181071 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.