i have a question. firstly sorry coz my grammar is not so good. i hope you all understand what question i will submit here..
the problem i face now is i cant retrieve all data that user already checked in checkbox. i want to edit the complete data. actually i need to modify the system that completely finish. so there no problem with saving or edit data.the problem is i just want to display data in checkbox.
there have data like days such as monday, tuesday, wednesday, thursday, friday, saturday n sunday. so when user checked monday and tuesday, i want if i go to the edit page, monday and tuesday already checked and the others uncheck. data already in the mysql. data hve been stored like monday, tuesday.
they separated by comma.
i used php and mysql.
here my code:
//php code
Expand|Select|Wrap|Line Numbers
- $getpost = $db->query_first("
- SELECT post.*, thread.*, post.postid, post.threadid, thread.threadid
- FROM " . TABLE_PREFIX . "post as post, " . TABLE_PREFIX . "thread as thread
- WHERE post.threadid = $threadinfo[threadid] AND
- post.threadid = thread.threadid
- ORDER BY post.dateline
- LIMIT 1
- ");
- $days = explode(",",$getpost['field23']);
- $day1 = $days[0];
- $day2 = $days[1];
- $day3 = $days[2];
- $day4 = $days[3];
- $day5 = $days[4];
- $day6 = $days[5];
- $day7 = $days[6];
Expand|Select|Wrap|Line Numbers
- <td width="150px"><input type="checkbox" name="fields[$threadfield[fieldid]][0]" value="Monday" tabindex="1"
- <if condition="$day1 != ''">
- <if condition="Monday == $day1">
- checked
- </if>
- </if>
- />Monday</td>
- <td width="150px"><input type="checkbox" name="fields[$threadfield[fieldid]][1]" value="Tuesday" tabindex="1"
- <if condition="$day1 != '' && $day2 != ''">
- <if condition="Tuesday == $day1 || Tuesday == $day2">
- checked
- </if>
- </if>
- />Tuesday</td>
values like $day1, $day2 and others at html page, but if i do if condition its not run smoothly.
anybody can help me?? please ??