70 Topics

Member Avatar for
Member Avatar for rayrenz

$string="City" $consonants=array("B","b","C","c","D","d","F","f","G","g","H","h","J","j","K","k","L","l","M","m","N","n", "P","p","Q","q","R","r","S","s","T","t","V","v","W","w","X","x","Y","y","Z","z"); foreach($consonants as $chk2) { if(strpos($string,$chk2)!= false) { $ans2[]=$chk2; } } if(isset($ans2)) { $comment2="Consonants in this string: ".join(" ",$ans2); } else { $comment2="Consonants in this string: None"; } echo "".$comment2."<br/>"; so the error is that the displayed consonants does not include the first letter. what could be wrong?

Member Avatar for Aravinth_2
0
368
Member Avatar for jj.dcruz

Hi there been having this problem for a while now and i need guidance the only thing that is showing me only **111** when looping through i have 3 data in my database and its not showing me the result i want any ideas?? thanks in advance **edit** the result …

0
296
Member Avatar for Dani

I'm having a little brain fart and I just want to double check something ... // Array of [a,b,c,d] $array = array('a', 'b', 'c', 'd'); // Loop through array foreach ($array AS $letter) { // Break out of the loop on a specific condition if ($letter == 'c') { break; …

Member Avatar for ryantroop
0
372
Member Avatar for fheppell

I have this function: function (Blobs) { console.log(JSON.stringify(Blobs)); // Make the progress bar here Blobs.forEach(function(Blob) { console.log(Blob); $.post(window.location.href + '/add', Blob); // Increment the progress bar by the correct amount, once above request has completed }); } (This function is passed as an argument, hence no name) I want a …

Member Avatar for fheppell
0
1K
Member Avatar for Jaklins

TLDR: When large amounts of files (array values) are in the array, the loop will iterate through all the values but only execute part of the foreach statement for some of them. When that happens, it will always affect the same files (in file order, not file name). Detailed version: …

Member Avatar for diafol
0
431
Member Avatar for adishardis

Hi, I would like to loop the data-attribute to contain all column names and values from a mysql table. This is what it looks like today: while ($row = $result->fetch()) { echo "<div id='{$row['namn']}' data-column1='{$row['column1']}' data-column2='{$row['column2']}'... So some kind of magic :) loop inside there so I don't have to …

Member Avatar for adishardis
0
252
Member Avatar for jj.dcruz

Im having a problem using foreach i cant seem to understand this yet. my problem is when i enter all the data needed it shows many inserting code I cant seem to figure this out This is the Output INSERT INTO `dependents`(`d_name`, `d_age`) VALUES (1,1) INSERT INTO `dependents`(`d_name`, `d_age`) VALUES …

Member Avatar for arunmagar
0
460
Member Avatar for arafath077

how to display this array.i tried sevaral way.does not working. Array ( [0] => Array ( [date] => Array ( [epoch] => 1401197400 [pretty] => 7:00 PM IST on May 27, 2014 [day] => 27 [month] => 5 [year] => 2014 [yday] => 146 [hour] => 19 [min] => 00 …

Member Avatar for delta_frost
0
268
Member Avatar for net4earning

i using this code to display radio buttons for selection. somehow the its not working correctly, plz guide on this issue. thanks in advance. <div class="register-section" id="user-role-section"> <label for="wp_rar_user_role"><?php echo $this->wp_rar_role_label; ?></label> <?php foreach($this->wp_selected_rar_roles as $role) { ?> <input type="radio" name="wp_rar_user_role" id="wp_rar_user_role" class="input select" value="<?php echo $role; ?>" /> <label> …

Member Avatar for net4earning
0
620
Member Avatar for CreatorZeus

i keep getting a error on the next page saying that hotel1 is an undefined index: page 1: foreach($child->children() as $gchild) { //echo ">> " . $gchild->getName() . ": " . $gchild . "<br>"; echo "<tr><td><input type='radio' name='my' value='my" . $gchild->name . "'></td>"; echo "<td><input type='checkbox' name='hotel". $r."' value='" . …

Member Avatar for pritaeas
0
205
Member Avatar for CJMW

So I actually posted this in the C# section, but despite peoples best efforts, all all the help there, the problem is still not solved. Background: Im making a game in xna/c# (Who isnt these days). For collision detection, I though I would use rectangles and lists. My thought process …

Member Avatar for CJMW
0
272
Member Avatar for castajiz_2

I would like to convert Control objects wich are in my array to progress bar Objects if possible. I know that the reverse conversion can be done explicitly without a problem but this one seems tricky. If impossible then please suggest something else instead. TNX

Member Avatar for castajiz_2
0
316
Member Avatar for Eagle.Avik

i am trying to get all the result from my databse table but this query is not working. <?php try { $pdo = new PDO('mysql:host=localhost;dbname=articles', 'Avik', ''); } catch (PDOException $e) { $output = 'Unable to connect to the database server.'; echo $output; exit(); } try { $sql = 'SELECT …

Member Avatar for pritaeas
0
336
Member Avatar for Indians

index.php coding <td><input type="text" name="slno[]" value="" size="2"></td> <td><input type="text" size="10" name="date[]" id="SelectedDate" onClick="GetDate(this);" readonly="readonly"/></td> <td><input size="24" type="text" name="particulars[]" value="" placeholder="Description"></td> <td><select name="noofnights[]" value="0"> <option value="empty"></option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option …

Member Avatar for Lsmjudoka
0
6K
Member Avatar for Szabi Zsoldos

Hey guys, I'm having difficulties with a problem. I iterate over an array of data with X rows And i have the positions of each row incremented, i would like that when i found an exception i shift all the position id's so after each exception the next ID has …

Member Avatar for Szabi Zsoldos
0
225
Member Avatar for everton.retweets

Hi Everyone... I have been digging around the web for the last two days trying to fix this problem myself, but have come to the realization that I need some help. I have a mysql query that selects all country names from my country db, (works as described) I then …

Member Avatar for phorce
0
731
Member Avatar for renierdbruyn

I have the following: in my **MODEL:** function get_advert() { $sql = "SELECT * FROM job_advert"; $advert = $this->db->query($sql)->result(); return $advert; } in my **CONTROLLER:** function get_detailed_list() { $job_advert = $this->ranking_model->get_advert(); echo '<pre>'; foreach ($job_advert as $j) { $job_id = $j->advert_id; $sql = "SELECT r.rank, a.advert_id AS job_id, a.job_title, d.firstname, …

Member Avatar for diafol
0
7K
Member Avatar for sammry

am trying to show assigned variable for failed submission on a smarty form. array assigned as $arr = array($_POST[number]); $smarty->assign(number,$arr); and on tpl form, i added as below. {foreach from=$number item=no} <input name="number[]" type="text" value="{$no[{counter start=1}]}" /> {/foreach} am starting the counter from 1 because this is for dynamically added …

Member Avatar for sammry
0
914
Member Avatar for nigelhow

Okay i have 2 variable named bid price and offer price . I need to fill in the values into the variables through cases. For each row of data ,i want to retrieve the rates for the currency pairs (eg. eur/usd,audusd) . I have 2 values for each currency for …

Member Avatar for broj1
0
236
Member Avatar for mmcdonald

Kill me now! I have two tables in my DB. One has a list of certifications and one has a list of exam boards. I need to list the exam boards in a foreach loop giving each one an accordion. The certifications must be listed under their correct exam board. …

Member Avatar for mmcdonald
0
837
Member Avatar for patk570

Hello everyone, I have a search form that i am working on, and I have a huge array of checkboxes that I am using so people can refine the search down to just 1 or 2 things if they want to. In the search.php page, i have an implode function …

Member Avatar for ndomba
0
471
Member Avatar for vishalonne

Is it possible to iterate using foreach loop on multiple groupBox. I have 6 GroupBox named as gBox1,gBox2,gBox3,gBox4,gBox5,gBox6 AND each gBox contain 21 ComboBox named as slot1,slot2,slot3,slot4,slot5.... so on out of which I want to select only 7 comboBoxes for operation. For eaxmple if user enter 2 in textbox then …

Member Avatar for tinstaafl
0
661
Member Avatar for rayidi

I'm dealing with a SOAP client response for a flight booking application, I successfully got the response, See the response below: <arzoo__response> <Response__Depart> <OriginDestinationOptions> <OriginDestinationOption> <FareDetails> <ChargeableFares> <ActualBaseFare>4850</ActualBaseFare> <Tax>4267</Tax> <STax>31</STax> <SCharge>0</SCharge> <TDiscount>0</TDiscount> <TPartnerCommission>0</TPartnerCommission> </ChargeableFares> <NonchargeableFares> <TCharge>0</TCharge> <TMarkup>0</TMarkup> <TSdiscount>0</TSdiscount> </NonchargeableFares> </FareDetails> <FlightSegments> <FlightSegment> <AirEquipType>321</AirEquipType> <ArrivalAirportCode>DEL</ArrivalAirportCode> <ArrivalDateTime>2013-05-20T08:00:00</ArrivalDateTime> <DepartureAirportCode>BOM</DepartureAirportCode> <DepartureDateTime>2013-05-20T06:00:00</DepartureDateTime> <FlightNumber>601</FlightNumber> <OperatingAirlineCode>AI</OperatingAirlineCode> <OperatingAirlineFlightNumber>601</OperatingAirlineFlightNumber> …

Member Avatar for diafol
0
8K
Member Avatar for while(!success)

Hi guys, I'm hoping you can help me find a more elegant solution to my query inside a foreach loop. Here is the loop in question: foreach (DataRow row in dt_blah.Rows) { SqlCommand sc = con.CreateCommand(); sc.CommandType = CommandType.Text; sc.CommandText = "select blah blah blah .. where S = @s1 …

Member Avatar for AleMonteiro
0
1K
Member Avatar for adishardis

Hi, I'm transferring data from one table to another and one of the fields is an email field. I would like to check if the emailfield is empty or otherwise faulty and skip that record if it is. This is how it looks at the moment but it's problamatic since …

Member Avatar for adishardis
0
469
Member Avatar for adishardis

Hi, I use this script to extract and insert the desired variables to mysql.It does the job. $xml = new SimpleXMLElement('file.xml'); foreach($xml->loanaccount as $mess){ $account_number= mysql_real_escape_string($mess->account_number); $main= mysql_real_escape_string($mess->main); $type= mysql_real_escape_string($mess->{'application-array'}->{'application-type'}), $date= mysql_real_escape_string($mess->{'application-array'}->{'application-date'}), //insert into databse mysql_query("INSERT INTO account (account_number, main) VALUES ('$account_number', '$main')") or die(mysql_error()); echo "inserted into mysql<br /><br …

Member Avatar for adishardis
0
216
Member Avatar for joshmac

I am getting the error message "Invalid argument supplied for foreach()". I can't see to figure out what. Below is my query. Is there something I'm missing? Thanks public function editRole($id) { $q = $this->_db->query("SELECT * FROM `" . TP . "roles` WHERE `ID` = '" . floatval($id) . "' …

Member Avatar for pritaeas
0
198
Member Avatar for streamland

Could you help me solve the problem The code bellow locate the image path just in "image1" Something like this id image1 image2 image3 image4 image5 image6 1 pic1 2 pic2 but I need to get something like this id image1 image2 image3 image4 image5 image6 1 pic1 pic2 pic2 …

Member Avatar for streamland
0
217
Member Avatar for tet3828

I can't seem to wrap my head around this. I'll need a seasoned programmer to push in the right direction. I have a listView with 7 sub items. What I'm looking to do is populate a table in an .mdb file with the data. The listView box is almost the …

Member Avatar for riahc3
0
220
Member Avatar for SeanKann

I'd like to search this before asking a question but I'm not sure exactly what to search for. Posting for help is always a last resort for me. What I'd like to find is I think it's called a loop? or foreach? I think.. What I want to do is …

Member Avatar for LastMitch
0
245

The End.