HOW TO INSERT MULTIPLE CHECKBOX VALUES TO DATABASE

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
poeta_eletrico
Forum Commoner
Posts: 32
Joined: Mon Dec 22, 2003 7:33 am
Contact:

HOW TO INSERT MULTIPLE CHECKBOX VALUES TO DATABASE

Post by poeta_eletrico »

Hi,

After trying to find any previously post here without success, I will try my luck now and hope some of you can understand ( I don t think is a hard thing to do ) and try to help me out because to me at this moment in programming is impossible:

The project is : I have a form to collect some informations of a logged in user. Tel. Numbers | Living Period ... all the informations is displayed into a table. The user must CHECK the Tel. Number that he will want to edit and confirm then the form. All this data will be later on INSERT into a database for consult.

My problem is all the rest of code is working properly. I can get only the CHECKED values to make a count (because every number has it s price) but I just can t figure it out how to parse the CHECKED numbers to a code and then insert them or it into my database, got it? Below is part of the code I am using:

Code: Select all

$sql = "select data,sip_id from sip where user_email = '".$userdata['email']."'";
	$resultado = mysql_query($sql);
	$valor_field = 0.01;
	while($result = mysql_fetch_array($resultado))
	{
		echo '<tr>';
		// get tel numbers in a loop
		echo '<td><strong>' . $result["sip_id"] . '</strong></td>';
		// fixed value for every number
		echo '<td align="center"><input type="texto" size="4" readonly name="unit_ammount' . $result["sip_id"] . '" value="' . $valor_field . '"></td>';

		echo "<td align="center"><input type="checkbox" name="chkCart" . $result["sip_id"] . "" onClick="setValue()"></td></tr>";
If you are paying attention I am running for parse the SUM with JAVASCRIPT.

I hope some of you can help me.

Kind Regards,
Poeta_Eletrico


feyd | Please use

Code: Select all

tags when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Post Reply