Hello, i have a problem. I want to do two things First, explode an array to retrieve the ids from a row on the table e.g. 1,5,23 and then use a variable to call a Mysql statement. Here is my code public function Show($times) { $q=mysqli_query($this->db,"SELECT to_uid_fk FROM table WHERE status='1' ") or die(mysqli_error($this->db)); $row1=mysqli_fetch_array($q,MYSQLI_ASSOC); if(strlen($row1['to_uid_fk'])>1) { $s = explode(",", $row1['to_uid_fk']); foreach($s as $a) { $query=mysqli_query($this->db,"SELECT row1,row2,to_uid_fk,times FROM table WHERE to_uid_fk='$a' ORDER BY row1 DESC ")or die(mysqli_error($this->db)); while($row=mysqli_fetch_array($query,MYSQLI_ASSOC)) { $times=$row['times']; $data[]=$row; } return $data; } } } and then i want to call this function on another file to run …

Member Avatar
Member Avatar
+0 forum 10

i want to explode a string two time and make a multi-dimensional array. $data = "i love funny movies \n i like daniweb dot com \n i like rock song"; $data = explode("\n", $data); so a `print_r($data);` will output: Array ( [0] => i love funny movies [1] => i like daniweb dot com [2] => i like rock song ) now if i do like this: $line_data = explode(" ", $data); // explode $data variable by spaces. a `print_r($line_data);` will give me this: Array ( [0] => i [1] => love [2] => funny [3] => movies [4] => …

Member Avatar
Member Avatar
+0 forum 1

The HTML: <!DOCTYPE HTML> <head> <link rel="stylesheet" type="text/css" href="/Users/Alireza/Desktop/Index.css" /> <script src="http://www.ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></script> <script type="text/javascript" src="/Users/Alireza/Desktop/Index.js"></script> </head> <body> <div></div> </body> The CSS: div{ height: 100px; width: 100px; background-color: red; border: 4px dashed #00FF00; } The jQuery: $(document).ready(function(){ $('div').click(function(){ $('div').effect('explode'); }) }) Please help me. I really don't know why it isn't working. Go ahead and try the code if it helps you. Thank you, in advance.

Member Avatar
Member Avatar
+0 forum 5

Hi I'm trying figure why I'm getting this error **Undefined offset: 1**. I'm practicing with **list()** function and with a **explode()** function. When I ran the code it kept mention this error: Undefined offset: 1 The line is this: list($bagsize, $candyprice)=explode("#", $_GET["size"]); The list is not an array. It's on the database: $bagsize = $_GET["size"]); $candyprice = $_GET["price"]); But the thing is that I don't understand why is it **offset**. I google it and read a few threads and find out it varies. I just want to prevent this error from happening again. Any Suggestions and explanations will help. I …

Member Avatar
Member Avatar
+0 forum 5

Well, I have just made this funtion that will split an array using a delimiter. I'm new to C++ so I will take any suggestions you have. Anyhow, good luck! Enjoy!

Member Avatar
Member Avatar
+0 forum 7

hi fellas, need some brilliant idea, i want to get the firstname,lastname,middlename of the employee below using javascript. ________________________ Atty.Jan Rex Camvarijan Rex Uy Cambarijan Rex Cambarijan Rex Ma.Rex B. Cambarijan ||| Rex del Rosario __________________________ what i really want is how could i separate lastname firstname middlename in those diffirent structuce of name thanks, =)

Member Avatar
Member Avatar
+0 forum 3

i have a problem to count explode function, here is my coding [CODE] <?php $query = "SELECT Indication, COUNT(Indication) FROM reg WHERE Indication IS NOT NULL AND Indication != '' GROUP BY Indication"; $result = mysql_query ($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ $medic = explode(",", $row['Indication']); for($i = 0; $i < count($medic); $i++){ echo "". $row['COUNT(Indication)'] ." - $medic[$i] "; echo "<br />"; } } ?> [/CODE] and my result is : a -1 a - 1 b - 1 c - 1 b - 1 c - 1 but i want the answer like this: a = 2 b …

Member Avatar
Member Avatar
+0 forum 1

Hey guys, I'm working on a ajax drop down system. I'm currently finding myself in a difficulty with a $_POST[]. The thing is that I want to explode my $_POST but it doesn't let me for something, cant find it out why. [CODE] case 2: if(strstr($_POST['modelBox'],'^')) { $ex = $_POST['modelBox']; $explodeBox = explode('^',$ex); if($explodeBox[1] == '') { $modelBox = ' WHERE model = "'.$explodeBox[0].'"'; } else { $modelBox = ' WHERE model = "'.$explodeBox[0].'" AND production_year = "'.$explodeBox[1].'"'; } $sql = 'SELECT DISTINCT(wheel_dimension),material FROM catalogue.wheel_code '.$modelBox.' ORDER BY wheel_dimension ASC;'; $depts = mysql_query($sql); while (list($wheel_dimension,$material) = mysql_fetch_array($depts)) echo $wheel_dimension."=".$wheel_dimension."*"; break; …

Member Avatar
Member Avatar
+0 forum 2

Hello, I looking for a piece of code to chop a string into a array with 2 or more delimiters example: this is the text and I want to chop [!FIRST!] here and a bit later [!LAST!] here and if its posible (its not required) [!OPTIONAL!] chop it here and store this in a array like [code]array( [0] => "this is the text and I want to chop " [1] => "[!FIRST!]" [2] => " here and a bit later " [3] => "[!LAST!]" [4] => " here and if its posible (its not required) " [5] => "[!OPTIONAL!]" [6] …

Member Avatar
Member Avatar
+0 forum 4

Hi, I can pass an array through jquery ajax. [CODE] var regSubCodeArray = new Array(); var temp = 9; var i; for(i=0;i<temp;i++) { subname = 'sub'+i; subcode = 'sub_code'+i; subcredit = 'sub_credit'+i; regSubCodeArray[i] = document.getElementById(subcode).innerText; } $.ajax({ url: "testArray.php", type: "GET", data: "page="+regSubCodeArray, cache: false, success: function (html) { $('#ttl').html(html); } }); [/CODE] In 'testArray.php', i did the following [CODE] echo $_GET['page']; [/CODE] It prints all the data of the array. But i want to access each data using some foreach loop in my testArray.php page. Can any-one help me??

Member Avatar
Member Avatar
+0 forum 7

The End.