The following code is erroring on the connection string line 5 it used to work but then i had to move the sql server to another box and now it fails have i forgotten to do something on the sql server or is there error in my code my error is Fatal error: Uncaught PDOException: SQLSTATE[08001]: [Microsoft][ODBC Driver 11 for SQL Server]Named Pipes Provider: Could not open a connection to SQL Server [53]. in C:\xampp\htdocs\dailysales\includes\CPeriodOrdersJson.php:5 Stack trace: #0 C:\xampp\htdocs\dailysales\includes\CPeriodOrdersJson.php(5): ->('sqlsrv:Server=F...', 'LocalAdmin', 'CrispyCrackers') #1 {main} thrown in C:\xampp\htdocs\dailysales\includes\CPeriodOrdersJson.php on line 5 <?php include("sqlcalendar.php"); $db = new PDO("sqlsrv:Server=FFP-X3DB\X3;Database=FFP_WebServices", "LocalAdmin", "CrispyCrackers"); $row=$db->prepare("FFP_WebServices.dbo.WEBSERV_PERIOD_ANNUAL_FIGURES_CUMMULATIVE_SELECT"); $row->execute();//execute …

Member Avatar
+0 forum 0

Dear Friends, I have a string with structure $selectedTime = "2017-02-10 07:00,2017-02-10 08:00,2017-02-11 09:00"; I need to convert it as   {"2017-02-10":[{"start":"07:00"},{"start":"08:00"}],"2017-02-11":[{"start":"09:00"}]} any idea ? please advise asap Thanks Anes

Member Avatar
Member Avatar
+0 forum 1

Hey folks. I currently have a large JSON file made up of entries similar to the below. The file contains information relating to photographs:- [CODE]{ "SourceFile": "C:/Users/Me/Desktop/Photos/5294030805_9497032cd7_o.jpg", "ExifToolVersion": 8.63, "FileName": "5294030805_9497032cd7_o.jpg", "Directory": "C:/Users/Me/Desktop/Photos", "FileSize": "1094 kB", "FileModifyDate": "2011:09:09 22:40:39+01:00", "FilePermissions": "rw-rw-rw-", "FileType": "JPEG", "MIMEType": "image/jpeg", "JFIFVersion": 1.01, "ExifByteOrder": "Big-endian (Motorola, MM)", "Make": "Apple", "Model": "iPhone 4", "Orientation": "Horizontal (normal)", "XResolution": 72, "YResolution": 72, "ResolutionUnit": "inches", "Software": "Camera+ 2.0", "ModifyDate": "2010:12:26 22:27:09", "HostComputer": "iPhone (iPhone OS 4.2.1)", "YCbCrPositioning": "Centered", "ExposureTime": "1/15", "FNumber": 2.8, "ExposureProgram": "Program AE", "ISO": 1000, "ExifVersion": "0221", "DateTimeOriginal": "2010:12:26 22:27:09", "CreateDate": "2010:12:26 22:27:09", "ComponentsConfiguration": "Y, Cb, Cr, -", …

Member Avatar
Member Avatar
+0 forum 4

Hey everyone, I have a JSON array that pulls data, its an immense amount of data that i use. It is a multilevel array eg: dateTime: 2018-12-04T10:30:45:222z comments:"" +Driver[0] [0] fname: John lname: Doe driverCode: DOEJ [1] fname: Mary lname: Smith driverCode: SMIMA more info etc I am trying to access dateTime, as well as driver.fname, driver.driverCode etc... here is what i have tried so far... var json = results; var li; for(var i; i=0; i < json.length; i++){ for (var j; j=0; j < json[i].driver.length; j++){ var stTime = new Date(json[i].dateTime); var status = json[i].status; var id = json[i].id; …

Member Avatar
Member Avatar
+0 forum 5

Hey everyone, I have a script that does an API call, the results are displayed in a json array, but i am trying to break them down into HTML tables here is my code var deviceId = ""; api.call("Get", { typeName : "DutyStatusLog", search : { deviceSearch : { driver : deviceId } } }, function (result) { if (result !== null && result.length > 0) { document.getElementById("dataString").innerHTML = JSON.stringify(result[0]) } }, function (errorString) { alert(errorString); }); and the output is : {"id":"aOfoqjT0Yr0igg2i3PCXrGg","location":{"location":{"x":-76.86248779296875,"y":41.004390716552734}},"status":"Login","origin":"Automatic","device":{"id":"b2F"},"dateTime":"2017-11-24T15:38:01.620Z","driver":{"id":"b12"},"state":"Active","malfunction":"None","version":"00000000000060c1","sequence":"000000000000025a","eventRecordStatus":1,"eventCode":1,"eventType":5,"distanceSinceLastValidCoordinate":0} WHat i want to know is how can i get this above string formatted into an HTML …

Member Avatar
Member Avatar
+0 forum 1

I know this title is rather confusing, but here it goes. I have a PHP cURL request and the return is in a string. Normally i can easily echo specific objects from the JSON response, but i have never dealt with string returns. Here is my php <?php $url = "http://profile.combatarms.nexon.net/en/api/ProfilePlayerV2/OG_KneeGro__"; $ch = curl_init($url); $headr = array(); $headr[] = "Host: profile.combatarms.nexon.net"; $headr[] = "User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:54.0) Gecko/20100101 Firefox/54.0"; $headr[] = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; $headr[] = "Accept-Language: en-US,en;q=0.5"; $headr[] = "Cookie: i18next=en; _ls_bid=__new__; device_id=a2b3c270-bb08-4afd-8839-4c794e71dded; fingerprintv1=655870065693bdf4ced7825e4fee1f7c4e7f8a37; ccc=US"; $headr[] = "Connection: keep-alive"; $headr[] = "Upgrade-Insecure-Requests: 1"; curl_setopt($ch, CURLOPT_HTTPHEADER, $headr); curl_setopt($ch, …

Member Avatar
Member Avatar
+0 forum 2

I am parsing below sample file in below code snippet. {"requestType":"INVOCATION", "hostName":"localhost", "serviceName":"bucky", "serviceType":"DISCRETE", "serviceParameters":"sampleData", "servicesList" :[ { "serviceName" : "ABC", "serviceParameters" : {"para1" : "value1", "para2" : "value2", "para3" : "value3"} }, {"serviceName" : "CBA", "serviceParameters" : { "para1" : "value90", "para2" : "value", "para3" : "value"} } ], "dataTransferMode":null } code snippet: #include <boost/property_tree/ptree.hpp> #include <boost/property_tree/json_parser.hpp> #include <sstream> #include <iostream> #include <boost/foreach.hpp> #include <map> using boost::property_tree::ptree; using namespace std; void print(boost::property_tree::ptree const& pt,vector <string> &service_list, map <string,string> &service_param) { using boost::property_tree::ptree; ptree::const_iterator end = pt.end(); string value; for (ptree::const_iterator it = pt.begin(); it != end; ++it) { //cout<<it->first<<":"<<it->second.get_value<std::string>()<<endl; …

Member Avatar
Member Avatar
+0 forum 2

I don't even know if I worded my question correctly, but here's what I have and here's what I'd like: I use an [attendance app](https://itunes.apple.com/us/app/attendance2/id536206472?mt=8) to track my basketball workout classes, and then I show the results on my site [here](http://www.50allstars.com/p/players.html). To achieve this, I send the csv provided by the app to my email, I click on the attachment to eventually add it to my FileZilla server, which then sends the info into a google doc that separates the data through a couple of sheets to provide an iFrame of the end result. I don't mind the steps, as …

Member Avatar
Member Avatar
+1 forum 5

Hello, I'm having trouble posting JSON to a url using Flask, AJAX and Javascript. Essentially, I would code using a library [Jquery Sortable](https://johnny.github.io/jquery-sortable/) to create a sorted list. From that sorted list I want to post to the server. The problem is that the server does not recieve the JSON post at all (or rather it doesn't know the content type). Now I've experimetned with multipe methods and it has led me to this issue of not posting. The information is posted below: {% extends "base.html" %} {%block title %}{{Title_Program}}{%endblock%} {% block styles %} {{super()}} <!-- In <head> --> <style …

Member Avatar
+0 forum 0

Hi guys, I have a rather interesting problem. Basically my application has a javascript object literal in this format: var myObject = '{text:"my text 1", anotherProperty1:"This is another property1", anotherProperty2:"This is another property2", anotherProperty3:"This is another property3"},' + '{text:"my text 2", anotherProperty1:"This is another property1", anotherProperty2:"This is another property2", anotherProperty3:"This is another property3"},'+ '{text:"my text 3", anotherProperty1:"This is another property1", anotherProperty2:"This is another property2", anotherProperty3:"This is another property3"}'; At some point I stringify it function exportString(){ var jsonString = JSON.stringify(myObject); ... } and jsonString contains this as expected: [ {"text":"my text 1", "anotherProperty1":"This is another property1", "anotherProperty2":"This is another property2", …

Member Avatar
Member Avatar
+0 forum 6

Hi guys, I'm looking into the possibility of writing some javascript (or using an API of course) to be able to search a collection of PDFs and return the results in a Json format for processing (mainly displaying them back to the user). I've played around a little bit with something called the adobe acrobat console, which essentially it's a console running inside adobe acrobat reader which allows you to run some javascript. The following simple snippet runs in that console and returns a list of results in all the PDFs selected: search.matchCase = false; search.wordMatching = "MatchAnyWord"; search.bookmarks = …

Member Avatar
Member Avatar
+0 forum 4

HI guys, I seem to be having an issue declaring a json string. The original string I have is this: var jsonString = '{ "details" : [' + '{"text":"Lorem ipsum dolor sit amet, consectetur 0", "firstName":"Jack0", "surname":"Dee0", "moreInfo":"This is extra information"},' + '{"text":"Lorem ipsum dolor sit amet, consectetur 1", "firstName":"Jack1", "surname":"Dee1", "moreInfo":"This is extra information"},' + ']}'; and if I parse it jsonStringParsed = JSON.parse(jsonString); console.log(jsonStringParsed); I get what I expected in the console, two objects: details:Array[2] 0:Object firstName:"Jack0" moreInfo:"This is extra information" surname:"Dee0" text:"Lorem ipsum dolor sit amet, consectetur 0" 1:Object firstName:"Jack1" moreInfo:"This is extra information" surname:"Dee1" text:"Lorem ipsum …

Member Avatar
Member Avatar
+0 forum 10

I have a form that creats a json array from user input data. Array ( [full_name] => First Name + Last Name [company_name] => Company Name [email] => Email [free_trial] => trial (Yes/No) [quota] => quota [contract] => 0 (0/1) [per_gb] => cost per gb [per_month] => contract length in months [wanaccel] => No (Yes/No) ) I need to send that to a php curl file so that it can be sent to an ip address. **How do I populate the curl data array from that json file?** Here is where I am starting with the curl page. <?php $url …

Member Avatar
Member Avatar
+0 forum 6

Hello All, i have run into an issue with my little project that i cannot seem to find much on and im at a lose for resources to check through. I am trying to get and use data that is being pulled from a json echo to my other php page but it is being echoed in real time due to ajax and a new javascript im not fimiliar with called angular that i am currently trying to learn which is probably why im stuck in the first place. here is my echo line in my ph file $result = …

Member Avatar
Member Avatar
+0 forum 1

Hi I am working on displaying json data in ul li with href, i can able to print only ![Capture01.JPG](/attachments/large/3/db569cebc3c426d0b02202cde151137c.JPG "align-center") but my expected output should be as below ![Capture-01.JPG](/attachments/large/3/133e4688d5b3f612fb3dbe8ba2f26f17.JPG "align-center") <script type="text/javascript"> var data= {"query":{"simple_query_string":{"query":"A*"}}}; $.ajax({ type: 'POST', //url: 'data.json', url: 'urllink', dataType: 'json', success: function (data) { arr= data.hits.hits; $.each(arr, function( index, value ){ t='<li><a href="#'+value._id+'" data-toggle="tab">'+value._source.title+'</a></li>' ; console.log(t); // t=value._source.title; $('#metric_id').append($('<ul>' ,{ text:t })); }); }, }); </script> <div id="metric_id"></div> Please help me to fix the issue.

Member Avatar
Member Avatar
+0 forum 1

Greetings everyone, I'm still new to android programming and currently leanrning how to connect to DB. I'm following a online tutorial but I'm still facing problems. The tutorial is about creat a registration form and sending it to the database through volley. I'm using .hostinger.ae as host and Android studio. Everything seems fine until I click the register button it give me an error of (Couldn't register ) I couldn't locate the error so please I would appreciate any help dbconnect.php <?php define('HOST','mysql.hostinger.ae'); define('USER','--'); define('PASS','--'); define('DB','u853541076_tuber'); echo "access done"; $con = mysqli_connect(HOST,USER,PASS,DB) or die('Unable to Connect'); and this is the …

Member Avatar
+0 forum 0

I'm trying to populate a multidimensional html table with data from a JSON. The idea is that the first row is with the dates and the next ones start with with the name of the value and for the value for the date in the first row. Just like and x-y kind of table. This is an example of my data: {"dataval": [ { "date":"2014-01-01 00:00:00", "value":25776510, "name":"ISLA--T" }, { "date":"2014-01-01 00:00:00", "value":789, "name":"ISLA--Total" }, { "date":"2014-01-01 00:00:00", "value":0, "name":"SLA-TSis" }, { "date":"2014-01-01 00:00:00", "value":0, "name":"PServSLA-CdS" } ]} This is what I want to achieve: <table style="width:100%"> <tr> <th></th> <th>date</th> …

Member Avatar
Member Avatar
+0 forum 1

Currently I have something like this (a bit modified): function function1($param) { $ans = @file_get_contents($param); if (!$ans) return ("Failure"); return json_decode($ans, true); } Extremely straight forward. However, the `file_get_contents()` gets answer from an API, that has proven to be a little stinky boa. It sometimes answers incorrectly, or "Access Denied" even though it shouldn't. It fails sometimes when it shouldn't, but re-requesting brings the expected result. So I "invented" something like this: function function1($param) { $ans = @file_get_contents($param); if (!$ans) { usleep(500); // Wait 500ms before re-requesting to prevent spamming queries $retry++; if ($retry >= 3) return ("Something is actually …

Member Avatar
Member Avatar
+0 forum 2

Anyone familiar with how to add a Galaxy S5 & S6 running Android Lollipop (5.x) to Chrome Web Device List; from what I know JSon is involved but I'm not familar with JSon, I hope I can get some help ?

Member Avatar
Member Avatar
+0 forum 12

Hi, I know parsing json data has been discussed lots but what I want is probably a little simpler I need a little editing to the bleow php script to work as convert json data and push it into MySQL table since the script work as reading the json data only! I'm not much familiar with php coding. Any help is appreciated in advance. <? $item_string = '{"para":{"Psize":"1","Doffset":"now","Did":"33","lang":"en","p":1,"tkn":"cls","subctegry":"14"},"req":"adv\/get_adv"}'; $ch = curl_init('http://example.com/webd/'); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $item_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($item_string)) ); $result = curl_exec($ch); $item = json_decode($result, true); //Database Connection mysql_connect("localhost","root","") …

Member Avatar
Member Avatar
+0 forum 7

I am trying to find information on best practices for json data. I am working on a client server app that will contain family information. For purposed of this question, this is an oversimplification of the database. I have a family table, an address table, and a family members table. There are also a number of other tables that contain email addresses, phone numbers, etc. For each family, there can be multiple addresses (for the old folks that fly south for the winter), and multiple family members and each family member can have multiple phone numbers and email addresses. The …

Member Avatar
Member Avatar
+0 forum 3

ID Arrival Departure ArrivalDate DepatureDate 1001 New York Holland 2009-09-23 2012-07-23 1301 Florida Germany 2010-10-23 2012-10-11 1401 New York Holland 2009-09-23 2009-09-25 1301 New York Beijing 2009-09-23 2010-09-21 1201 New York Holland 2008-01-01 2009-09-23 1001 Virginia New York 2008-01-01 2009-09-22 1021 New York Holland 2009-09-23 2009-09-25 1001 New York Holland 2009-09-24 2012-07-23 1021 New York Holland 2009-09-26 2012-07-23 1001 New York Holland 2009-09-25 2012-07-23 ….... …......... …........ ….............. …................ 1001 New York Holland 2012-07-23 2012-07-23 1401 New York Holland 2009-09-25 2009-09-25 1301 New York Beijing 2010-09-21 2010-09-21 1201 New York Holland 2009-09-23 2009-09-23 1001 Virginia New York 2009-09-22 2009-09-22 1021 …

Member Avatar
Member Avatar
+0 forum 3

I am have debugging some javascript code in firebug,then i have seen some strange POST thing in firebug this is worrying me? I have registration form when i reload page i see in firebug following "POST http://api.adsrun.net/post" Response Header Cache-Control no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Connection keep-alive Content-Type application/json Date Mon, 09 Nov 2015 13:25:43 GMT Expires Thu, 19 Nov 1981 08:52:00 GMT Pragma no-cache Server nginx/1.9.4 Set-Cookie PHPSESSID=a0f52694494daab764d719b907baff6b; expires=Sat, 07-Nov-2020 13:25:43 GMT; Max-Age=157680000 ; path=/ Transfer-Encoding chunked access-control-allow-cred... true access-control-allow-head... Content-Type access-control-allow-orig... http://localhost p3p CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV …

Member Avatar
+0 forum 0

I want to parse json to html, with angularjs, i am converting an xml rss feed to json with npm xml2json I am using angularjs http to get an xml from the server, i am using node module xml2json to convert it to a json object. I get the document returned properly but it doesn't look right because it has html tags in the xml document. If anyone knows how to convert the returned json properly that would be great, var x2js = new X2JS(); var dom = x2js.xml_str2json(escapchr); <my_data> <p class="justify">El <strong><em>Content Tour 2015</em></strong> <strong>Distributors </strong></p></my_data> I am still …

Member Avatar
+0 forum 0

Getting an unexpected error don't know what the hell is wrong as everything is perfect as far as I noticed Parse error: syntax error, unexpected '=' in C:\wamp\www\dropbox-sdk\index.php on line 18 <?php session_start(); require_once "lib/Dropbox/autoload.php"; $_SESSION["user_id"] = 1; $dropboxKey = ''; $dropboxSecret = ''; $appName = 'puttiapp/1.0'; $appInfo = new Dropbox\AppInfo($dropboxKey, $dropboxSecret); $csrfTokenStore = new Dropbox\ArrayEntryStore($_SESSION, 'droppbox-ayth-csrf-token'); $webauth = new Dropbox\WebAuth($appInfo, $appName, 'http://localhost/editmate/dropbox_finish.php', $csrfTokenStore); $database = new PDO(mysql::host=localhost;dbname=editmate;dbuser=root); $user = $database->prepare("SELECT * FROM users WHERE id = :user_id"); $user->execute(['user_id' => $_SESSION['user_id']]); $user = $user->fetchObject(); var_dump($user); ?>

Member Avatar
Member Avatar
+0 forum 2

Hello recently I downloaded dropbox SDK and Ii's located in my downloads folder and it's dragging me to hell how do we install it no proper description provided nor a good details so we would be able to install it can anyone help me out there is no code to be posted so I am asking for help please do not ask me to provide such code as this question do not have any codes

Member Avatar
Member Avatar
+0 forum 3

Dear Daniweb friends, I created adapter like this: public class PromotionAdapter { String code = null; String name = null; String continent = null; String region = null; public PromotionAdapter(String code, String name, String continent, String region) { super(); this.code = code; this.name = name; this.continent = continent; this.region = region; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getContinent() { return continent; } public void setContinent(String continent) { this.continent = continent; } …

Member Avatar
Member Avatar
+0 forum 3

Hi all, My project is on ruby on rails. I have one of ruby api returns json.jbuilder But I want that my api should not return json , it will display html.erb file Is anybody can help me???

Member Avatar
+0 forum 0

I need to get user manipulated data out of my WinJS listview and convert it to JSON, but I can't figure how to access the data? Any help would be appreciated!

Member Avatar
+0 forum 0

I have a JSON decoded array in php with foreach that includes a select option in a form every time I select an option from this drop down it returns the last value in the list. The option is just the selector not the value I'm trying to save. I'm trying to save the flatnumber,building,address1,address2,town,county variables into hidden inputs. How do I go about this? Any help really appreciated!! $api_url = 'http://rest.api?postcode=' . urlencode($_GET['postcode']); $api_json = file_get_contents($api_url); $api_array = json_decode($api_json, true); $address = $api_array['addresses']; foreach($address as $addresses){ echo '<option>'.$addresses['address'].'</option>'; $flatnumber = $addresses['flatNumber']; $address1 = $addresses['building']; $address2 = $addresses['address1']; $town = …

Member Avatar
Member Avatar
+0 forum 5

The End.