last day (14 days later) » 

8:58 AM
1
A: IMPLODE data by checkbox

The FlashYou can do something like: $results = "Bouqet,flower arrangment"; //results from your database $resultsArray = explode(",", $results); //split the comma $checkValue = array("Bouqet", "flower arrangment", "other"); //your checkbox values $html = ""; foreach($checkValue as $val) { if(in_arra...

 
the problem is that the user can add more occasions and categories
Can i make a query to select all occasiosn and put them in an array ?
 
I am not sure if I understand what you are saying, can you please elaborate
@SigmondGatt of course, the array you see on my answer is just an example
 
thank you very much :). i will try it .
 
thanks you......
 
Hey broo, sry for distrubing you , can you make me a fiddle with a query instead of an array, SORRY FOR BEING EGOIST. (query SELECT * FROM tbl_occasions)
Only the checkvalue i dont know how to do.
 
8:58 AM
I cant do the query on the fiddle because the fiddle doesn't have a database.....how were your check-boxes at first? where were you getting those values? from the query? show me that part and I will change my answer to accomodate that
 
$query544="SELECT name FROM tbl_occasions"; $results544 = mysqli_query($conn, $query544) or die("Error in query: ". mysqli_error($conn)); $resultsArray = explode(",", $results544); $checkValue = array($resultsArray); $html = ""; foreach($checkValue as $val) { if(in_array($val,$resultsArray )) $html .= '<input type="checkbox" name="flower" value="'.$val.'" checked>'.$val.'<br>'; else{ $html .= '<input type="checkbox" name="flower" value="'.$val.'">'.$val.'<br>'; } echo $html; error:explode() expects parameter 2 to be string, object given in line ....
<div class="table-responsive col-md-4"> <table> <thead>Occasions</thead> <?php $query23 = "SELECT * from tbl_occasions"; $result23 = mysqli_query($conn, $query23) or die("Error in query: ". mysqli_error($conn)); while ($row = mysqli_fetch_assoc($result23)) { ?> <div class="col-md-12"> <label class="checkbox" for="checkboxes"> <input type="checkbox" name="reg_occassions[]" value="<?php echo $row['name'];?>"><?php echo $row['name']?> </label></div> <?php }?></table>
the second one is where i get the values of the cehcbox the first one is the code i tried that you gave me soryy :P
 
check my edited answer
 
thank you i will try , sorry for wasting your time i really appreciate
I tried it and it is not working fine can you add me skype i send a friend request so i cant finish this thing please. we are nearly there
 
show me the code you tried, copy and paste the whole thing into a fiddle jsfiddle.net , save it and send me the link
 
Fiddle it working all fine i repair everything the only problem is the design because if the first checkbox is selected it becomes like thead than i try with divs.. i copy paste the link of the fiddle dont know if it works or no
 
8:58 AM
i dont understand what you're saying, you mean it looks like this: CLICK ME ???
 
i will edit the question and post an image of the interface
 
okay, I will check it
 
edited. you can have a look.
 
okay, please wait, i am fixing it
 
thank i really apreciate
 
8:58 AM
it is doing that because of the <label> tag that is not closed, try copy and paste this UPDATED LINK - please also copy and paste the css you see on the right corner, it will also help
 
i edit the question again and this what happens when i copy and paste your code, right now i am editing photos so if you want leave it and i try my self .. thanks for your time
 
I wish i could jump into your browser and right click > then inspect, am sure its a small html/css issue, try to play around with it, try to also remove style="display:block;" on the input
 
i try something wait
thx bro i really really appreciate !!!
 
it works?......
 
no :/ .. no problem i will find how
yeahh check the answer ! :D.. thannk you !!
 
8:58 AM
I see it, great!
 
Flash i know that i am an egoist person. But you know how for example : The user will choose Valentines from a dropdown lost and i show all the flowers that valentine's checkbox is checked in a table. If you don't have time no problem.
 
give me your skype username
 
sigmond gatt
i sent you a friend request on : luthando.ntskewa1
 
wrong spelling, its luthando.ntsekwa1
 
i sned you a request
send*
 

last day (14 days later) »