[Solved] Print lists in list

Not sure what you mean with “store the data of ‘li1’ into an index”. I’m assuming you want a list of lists? You could append the list. k = “/BTC” result_list = [] for i in range(l): if k in dat1[“Data”][i][‘Label’]: value = dat1[“Data”][i][‘Label’] value1 = dat1[“Data”][i][‘TradePairId’] value2 = dat1[“Data”][i][‘AskPrice’] value3 = dat1[“Data”][i][‘BidPrice’] result_list.append([value, value1, … Read more

[Solved] how to create dynamic array and adding dynamic values using jQuery.

You can do it : Create table Jquery: $(“#my_id_container”).html(“<table><thead></thead><tbody></tbody></table>”); Html: <div id=”my_id_container”></div> Add value of this tableau : $(“#my_id_container”).find(‘table tbody’).append(‘<tr>My new ligne</tr>’); solved how to create dynamic array and adding dynamic values using jQuery.

[Solved] td .cssClass – is this a valid construct? [closed]

If you use a preprocessor like sass, you can nest selectors like that. Not with normal css though. With normal css you would need to do tbody tr td .plusIcon { background: url(../img/left-arrow-blue.png) 15px 18px no-repeat; vertical-align: bottom; padding-left: 42px; } tbody tr td .minusIcon { background: url(../img/down-arrow-blue.png) 15px 18px no-repeat; vertical-align: bottom; padding-left: 42px; … Read more

[Solved] how can foreach mysql result?

Try PDO. It’s a much better and safer way of interacting with databases for PHP. http://php.net/manual/en/pdo.connections.php $dbh = new PDO(“mysql:host=$host;dbname=$dbname”, $user, $pass); $hetimostfin = array(); $coppers = 3000; $line = 0; $query = <<<SQL SELECT playerID, COUNT(valami2) AS `count` FROM players_extra GROUP BY playerID; SQL; foreach($dbh->query($query, PDO::FETCH_ASSOC) as $row) { $hetimostfin[[$row[‘playerID’]] = $row[‘count’]; // execute … Read more

[Solved] How to convert a 16-bit hexadecimal number to binary number and then count number of zeros and one in it ? Using simplest C program

#include <stdio.h> #define MAX 1000 int main() { char binarynum[MAX], hexa[MAX]; long int i = 0,number_of_zeros=0,number_of_ones=0; printf(“Enter the value for hexadecimal “); scanf(“%s”, hexa); printf(“\n Equivalent binary value: “); while(hexa[i]) { switch (hexa[i]) { case ‘0’: printf(“0000”); number_of_zeros +=4; break; case ‘1’: printf(“0001”); number_of_zeros +=3; number_of_ones +=1; break; case ‘2’: printf(“0010”); number_of_zeros +=3; number_of_ones +=1; … Read more

[Solved] Filter JSON value encapsulated inside HTML DOM using Regex

Code: (Demo) function extractColumnData($html,$key){ if(!preg_match(“~\.put\(‘\d+’,\s+(.+?)\);~”,$html,$out)){ return “alert yourself of the preg_match failure”; } if(($array=@json_decode($out[1],true))===null && json_last_error()!==JSON_ERROR_NONE){ return “alert yourself of the json decode failure”; } return array_column(current(array_column(current($array),’options’)),$key,’name’); // this assumes the static structure of your json/array data } $html=<<<HTML <script> HZ.productVariation.Manager.setSpaceId(‘33503761’); HZ.data.Variations.put(‘33503761’, {“availVar”: [{“id”: “c”, “label”: “Color”, “options”: [{“name”: “Chrome”, “avail”: 1, “stock”: 1, “price”: … Read more

[Solved] div.style.display not working when declared inside a function

First you are not calling hidden function. If you want to call it then remove classList.add var p1 = document.getElementById(“p1”) var h2 = document.querySelectorAll(“h2”)[0]; function hidden(elem) { elem.style.display = “none”; } h2.addEventListener(“click”, function() { hidden(p1) }) h2 { cursor: pointer; } <h2> I am h2</h2> <div id=”p1″> I am p1</div> solved div.style.display not working when … Read more

[Solved] How to Remove Duplicates Values from table [duplicate]

Since your screenshot is of phpMyAdmin, I’m going to assume that we’re talking about MySQL here (when asking questions, that’s helpful information as various SQL dialects have different tools that can be used). If you don’t need id in your results, you can just use DISTINCT: SELECT DISTINCT Username, Video FROM YourTableName This returns a … Read more

[Solved] bind_param for php pdo for select

I rectified that above and got error on below public function getAllRecord($table){ $result = $this->con->prepare(“SELECT * FROM “.$table); $result->execute(); $results = $result->fetchAll(); $rows = array(); if ($results->rowCount > 0) { while($row = $results->fetch(PDO::FETCH_ASSOC)){ $rows[] = $row; } return $rows; } return “NO_DATA”; } Error:Notice: Trying to get property of non-object in C:\xampp\htdocs\inv_project\public_html\includes\DBOperation.php on line 68 … Read more