Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
hey stuck with looping through form...plisssss some aid
Old 07-29-2009, 04:24 PM hey stuck with looping through form...plisssss some aid
Banned

Posts: 34
Trades: 0
i am a form with checkboxes, i loop them and put values in a query.

ok here is the problem , initaly there were 4 checkboxes "check[]"

i used :

foreach($_POST['select'] as $key=>$value) {



$query = "insert into tblenroll values (NULL, '" . $this->cleantext($who) . "','" . $this->cleantext($value) . "','" . $this->cleantext($listmenu) . "')";

$result = $dbunique->query ( $query );

}

THis worked ok , now i had to add a new colum to tblenroll and fill it in with a "1 or 2"
each checkbox will have a status select ex-> checkbox[], listmenu[]
so i need to loop though listmenu[] which will bring the value to $listmenu.
But.... i cant get it right!!!
Necaxa is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-31-2009, 02:23 AM Re: hey stuck with looping through form...plisssss some aid
Novice Talker

Posts: 8
Trades: 0
It seems obvious to me that the problem stems for the fact that your new new column (enumerated) can only accept 1 or 2. I would recommend you echo each query (echo $query) to see what values have been entered. That way you can see whether or not the data sent by the form includes the 1s and 2s your new column is expecting.

The best way to debug a database error is to look first at the query.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
holyhttp is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to hey stuck with looping through form...plisssss some aid
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.24979 seconds with 12 queries