Jump to content

save html table to database table


richrock

Recommended Posts

Hi all,

 

many apologies if this is a noob question, but it's something I'm not sure if it's the right way to go about something.

 

I've created a dynamic html table based on a category search (table_categories), and displayed it with:

 

// Create the table full of sale data
	while ($row = mysql_fetch_assoc($rSaleList)) {

		echo "<tr>\n";
		echo "<td width='65'>\n";
		echo $row['id'];
		echo "</td>\n";
		echo "<td width='140'>\n";
		echo "<input type='text' name='catname' value='".$row['day']."' size='1' maxlength='2' />-<input type='text' name='catname' value='".$row['month']."' size='1' maxlength='2' />-<input type='text' name='catname' value='".$row['year']."' size='3' maxlength='4' />";
		echo "</td>\n";			
		echo "<td width='275'>\n";
		echo "<input type='text' name='catname' value='".$row['catname']."' />";
		//echo $row['catname'];
		echo "</td>\n";

		echo "</tr>\n";

	}

 

As you can see, I've added the input boxes, as I intend the end user to edit any of the fields (this is accessible by an admin only) but have no idea how to write the results back to the table.  I'm sure it's something like

 

UPDATE table_category (`catid`,`catname`,`day`,`month`,`year`) VALUES ( not sure here, but pretty certain it needs to follow the array above)

 

Help!  ???

Link to comment
https://forums.phpfreaks.com/topic/124291-save-html-table-to-database-table/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.