[Solved] Associative array index as variable

Try foreach ($array1 as $index => $arr1) {…} foreach ($array1 as $key1 => $val1 ) { foreach ($array2 as $key2 => $val2) { echo $arr2[$arr2[$key1][$key2]]; } } 0 solved Associative array index as variable

[Solved] How do I post multiple parameters to a URL

If I’ve understood your requirements you need to pass method as a string, then JSON encode the params object. If so, this should work for you: $.post(‘https://liceoeuroamericano.territorio.la/webservices/persona.php’, { method: ‘activateUser’, params: JSON.stringify({ auth_key: “123456”, user: “[email]”, active: “[0/1]” }) }, function(data){ console.log(‘request completed successfully’); }) 1 solved How do I post multiple parameters to a … Read more

[Solved] PDO states I am missing tokens, But I am not – what’s wrong with this [closed]

You are setting the query before you add the filter to the query string. // Get the results from the query $query->setQuery($sqlSelect) ->setParameter(‘startMonth’, $startMonth) ->setParameter(‘endMonth’, $endMonth); if (!empty($filter)) { $sqlSelect .= ‘AND LOG.VALUE LIKE :filter ‘; $query->setParameter(‘filter’, ‘%’.$filter.’%’); } You are setting the query to $sqlSelect and aftwards appending the filter part after setting the … Read more

[Solved] Parse error: syntax error, unexpected ‘function’ (T_FUNCTION) in /home/u610435277/public_html/wp-content/themes/zerif-lite/inc/jetpack.php on line 1 [duplicate]

Parse error: syntax error, unexpected ‘function’ (T_FUNCTION) in /home/u610435277/public_html/wp-content/themes/zerif-lite/inc/jetpack.php on line 1 [duplicate] solved Parse error: syntax error, unexpected ‘function’ (T_FUNCTION) in /home/u610435277/public_html/wp-content/themes/zerif-lite/inc/jetpack.php on line 1 [duplicate]

[Solved] Anti spam for web forms? [duplicate]

There’s CAPTCHA solutions.. though not always user-friendly, I’ve had to look into other ventures to help overcome spam (though never 100%). One solution over not using CAPTCHA is to add a hidden input with a value. In JavaScript, delete that hidden input. On the server side, test if it was posted or not. If it … Read more

[Solved] how to append multiple values to an associative array? [closed]

Seem you need to do something like this, $values = array(); while($row = mysql_fetch_array($result)) { $values[$row[‘MONTHNAME(dt)’]] = $row[‘SUM(dist)’]; } print_r($values); If you need an associative array than do like. $values[] = array($row[‘MONTHNAME(dt)’] => $row[‘SUM(dist)’]); Note: Please, don’t use mysql_* functions in new code. They are no longer maintained and are officially deprecated. See the red … Read more

[Solved] Getting blank array from web service

Use urlencode() This is working now : <?php $post_name=”BSN Syntha-6 Isolate”; $base = “http://52.53.227.143/API_test.php?post_name=” . urlencode($post_name); $str = file_get_contents($base); echo ‘<pre>’; print_r(json_decode($str)); ?> 2 solved Getting blank array from web service

[Solved] How to use break in if (Command) [closed]

Something like that? $i = 0; foreach($string as $menu){ $i++; if($i == 6){ break; } $menu_name = $menu[‘name’]; $menu_style = $menu[‘style’]; // i want to show total 5 menu names. if($menu_style == ‘magazine’ && $i <= 5){ // i have 5+ menus names (magazine style) // butt here i want to show just one last … Read more

[Solved] i have stored array in database as a string how can retrieve that array?

use JSON_ENCODE first before saving the array to DB ,then use JSON_DECODE if you want to get again the contents $arr = array( “item_number1” => “1”, “payment_date” => “04:21:34 Dec 06, 2014 PST”, “payment_status” => “Completed”, “first_name” => “sdfsd”, “last_name” => “parsdfsdandekar”, “quantity1” => “1” ); echo json_encode($arr); Result after JSON_ENCODE (Array to JSON String): … Read more

[Solved] show sql results in php with tables [closed]

In your __construct seem you don’t call the proper function sequence for format (htlm) the row. I think you should change you __construct someway for call beginChildren, current, endChildern properly function __construct($it) { beginChildren(); parent::__construct($it, self::LEAVES_ONLY); current(); endChildren(); } solved show sql results in php with tables [closed]