Jump to content

[SOLVED] Display table data and make edittable?


Recommended Posts

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.