Jump to content

sarahaziz2002

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Everything posted by sarahaziz2002

  1. I like your answer but i wish to display it as a list and list items. And also if you could tell me what does this step mean? for($row=0; $row<$cellsPerCol; $row++) { $tableOutput .= " <tr>\n"; for($col=0; $col<$columns; $col++) { $index = ($col*$cellsPerCol+$row); $tableOutput .= (isset($cells[$index])) ? $cells[$index] : ''; } $tableOutput .= " <tr>\n"; }
  2. Hello guys, @mjdamato:OK the way your thinking is fine.But the thing is that i found this function to split the list into 3 or 4 lists.So i need to add all data in one array to split it. here is the function: function split_array($array, $slices) { $perSlice = floor(count($array) / $slices); $sliceExtra = count($array) % $slices; $slicesArray = array(); $offset = 0; for($i = 0; $i < $slices; $i++) { $extra = (($sliceExtra--) > 0) ? 1 : 0; $slicesArray[] = array_slice($array, $offset, $perSlice + $extra); $offset += $perSlice + $extra; } return $slicesArray; } Also one more thing i need to change the group name to bold so any ideas? Any ideas?
  3. Now even if i get them into one query how do i add them into one array. The queries: $sql = mysql_query('SELECT id,login FROM groups,simulationgroups WHERE Simulation_ID = 5 and id = simulationgroups.Group_ID and kind_of_user NOT IN (1,2) $result = mysql_fetch_array($sql); $sql2 = mysql_query("SELECT * FROM users WHERE Group_ID = ".$result['id']) $result2 = mysql_fetch_array($sql2); how do i add them into one array each group followed by it's users.
  4. Thanks for your reply But put into account that i get these results from 2 different queries so how to do it? Also i wish to add them into just one array.
  5. Hello Guys This is the first time i ask a question at php freaks. Hope i could find the answer. I want to create something similar to the image now the problem is that i want to get groups and their users in the same array. Notice something like Array [0] => Group1 [1] => user1 [2] => user2 [3] => Group2 and so on. How could i do that. Thanks in advance.
  6. Hello Vincent i have the same problem but i don't know where is the error. And if i want to create new input elements and insert into mysql database how could i change the code to do so. This is the code <form method="post"> <input type="hidden" id="max_id" value="1"/> <table> <tr> <td align="left"><h2>Animation Group</h2></td> <td><input type="button" value="Rename"/></td> </tr> </table> <table> <tr> <thead> <tr> <th><h5>user name</h5></th> <th><h5>user real name</h5></th> </tr> </thead> <tr> <td><input type="text" name="rolename[]" id="rolename[]" value=""/></td> <td><input type="text" name="rolerealname1" id="rolerealname1"/></td> <td><input type="button" value="Edit"/></td> </tr> <tr> <td><input type="text" name="rolename[]" id="rolename[]"/></td> <td><input type="text" name="rolerealname2" id="rolerealname2"/></td> <td><input type="button" value="Edit"/></td> </tr> <tr> <td><input type="text" name="rolename[]"/></td> <td><input type="text" name="rolerealname3" id="rolerealname3"/></td> <td><input type="button" value="Edit"/></td> </tr> </table> </form> <div><input type="submit" value="Save" onClick="saveData()"/></div> javascript function saveData() { $.post("groups_users.php", $("form").serialize(), function(returned_data) {alert(returned_data);}); } php <?php foreach($_POST['rolename'] as $var => $value) { $_POST[$var] = addslashes($value); echo $value; } ?>
×
×
  • 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.