Could not open socket to 'www.londonstockexchange.com', 'Connection refused Any ideas how i can get past this? Direct connection to this site is blocked somewhere. If you are inside a company there is probably a firewall and some proxy you are required to use. Ask your system administrator....
$host="mysql:host=".$host_name.";dbname=".$dbname; $ques_code=1; $dbh = new PDO($host, $dbuser, $dbpass); $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $S=$dbh->prepare("SELECT q_code FROM question_code_submission WHERE q_num = :id"); $S->bindParam(':id', $ques_code); $success = $S->execute(); if(!$success){ echo "Query failed !!"; }else{ $result=$S->fetch(PDO::FETCH_ASSOC); $code_name = $result['q_code']; echo $code_name; } ...
php,loops,foreach,while-loop,fetch
Since your 2 foreach loops of $dom->find are being located in a single while loop you're basically iterating over all the DOM elements that answers your criteria (td[...]). Those loops have no dependency in the while's loop so I would say it's not efficient. Moreover, you're using constant keys for...
It depends on what you like or need. PDO::FETCH_ASSOC makes fetch return an associative array. PDO::FETCH_OBJ is similar, but return an 'anonymous object' with properties. Note that actually 'anonymous object' is the wrong term, but the PHP documentation also uses it. It refers to an object that inherites from StdClass....
Just fetch the Person. Fetching the attributes will be done for you in an optimized fashion once you need the attributes. You simply access the attributes (assume they are already there). NSString *message = [NSString stringWithFormat:@"Hello, %@.", person.first]; If you need the addresses, you get them with NSSet *addresses =...
Add ORDER BY id ASC to sql_qrp....
Do this - <?php $mysqli = new mysqli('host', 'username', 'password', 'db'); $SQL = "SELECT * FROM users"; $result = mysqli_query($mysqli, $SQL); while ( $db_field = mysqli_fetch_assoc($result)) { ?> <a href="/<?php echo $db_field['username'];?>"><?php echo $db_field['username'];?></a><br/> <?php } mysql is deprecated. Use mysqli or PDO instead....
I'm not sure what is the data type of LAT and LON in your table POSTCODE. But whatever variables you define to fetch data into, they must match these types. For examples, assuming that LAT and LON are of the type NVARCHAR2, then I would rewrite your declaration section as...
As with (almost) anything, the way to find the optimal size for a particular parameter is to benchmark the workload you're trying to optimize with different values of the parameter. In this case, you'd need to run your code with different fetch size settings, evaluate the results, and pick the...
<input type="submit" value="Save"></input> you missed name attribute here changed it to <input type="submit" name="submit" value="Save"></input> ...
python,imap,fetch,imaplib,imapclient
ALL isn't a fetch item, it's a macro. A bit a special case in the syntax. There are two others, FAST and FULL. They're like fetch items but with some extra restrictions, one of which you've run into. I suggest that you just use the equivalent fetch items and you'll...
HQL does not respect fetch="join" (in the mapping). I explicit it adding fetch in the join: select pc from Purchase as pc inner join **fetch** pc.Product as p left outer join **fetch** p.Brand as b ... and it works: only one query is executed....
Your solution is not working yet. I tried to copy the $vacancies into the subject define field, but then the subject of the mail is empty. I have two files, one mailform and one form.lib. In the mailform I have this code: <input type="hidden"style="font-weight:bold" formmethod="POST" name="field_5" id="field_5" value=" <php str="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];...
python,xml,batch-file,vbscript,fetch
Let's utilize python! it's extremely easy to do that in python. and since you said it's ok to make a solution in python, check the script below. here's how you can iterate over a directory contains xml files and process them as requested in python while saving the file changes....
neo4j,nodes,fetch,spring-data-neo4j,spring-data-neo4j-4
This issue has been fixed post 4.0.0M1, please use the latest build snapshot, thanks.
core-data,entity,relationship,fetch,record
Finally I got the solution. This can be done as simple as following: NSPredicate *peopleFilter = [NSPredicate predicateWithFormat:@"ANY events.eventType contains %@",@"love"]; NSArray *people = [Person MR_findAllWithPredicate:peopleFilter]; return people; (A person has an array of events)...
As you say, when you do this: if($stmt->fetch()==null) the code fetches the first row. If it doesn't exist, the condition triggers. Otherwise, it goes on, and when you start fetching rows "for real", the first one has already been fetched. What you could do instead is checking the number of...
sql-server,sql-server-2012,sql-order-by,fetch,offset
By adding an identity column to the temp table variable declare @TempTable table([some columns], rownr int identity(1,1) ) INSERT INTO @TempTable [some columns] select [some columns] from table1 order by col1 INSERT INTO @TempTable [same columns] select [some columns] from table2 order by col2 An automatic incrementing number is added...
hibernate,join,left-join,fetch
Adding the other associated collection as 'join fetches' in the query fixed it, and the whole thing ran in 1 query. I think using a query overrides the default fetch strategy, but the fact that there were other relations in there not being join fetched meant that Hibernate treated them...
Is there a way i can create a conditional to use the correct code and always shows the thumbnail? Sure there is. You've not said in your question what blocks you so I have to assume the reason, but I can imagine multiple. Is the reason a decisions with...
Well you can first fetch the photos and the videos as you did, but before writting the HTML. For example you can put your results into a $photos and $videos arrays. then you can check if both variables has results, and if it is the case write only the HTML...
I figured out how to get the body text now. cmd, _ = c.UIDFetch(set, "RFC822.HEADER", "RFC822.TEXT") // Process responses while the command is running fmt.Println("\nMost recent messages:") for cmd.InProgress() { // Wait for the next response (no timeout) c.Recv(-1) // Process command data for _, rsp = range cmd.Data {...
Forgot to post this, redid the code with prepared statements and it works, not sure what exactly I changed but here it is anyhow: $jobnumber = $_GET['jref']; $stmt = $conn->prepare( "SELECT `Job Name`, `Address`, `phone`, `description`, `materials` FROM po_10152796 WHERE po = ?"); $stmt->bind_param("i", $jobnumber); if($stmt->execute()){ $stmt->bind_result($jobname, $address, $phone, $description,...
using ->fetch(PDO::FETCH_ASSOC) $search->execute(); while($row = $search->fetch(PDO::FETCH_ASSOC)){ echo "Title: " . $row['comicTitle']."<BR>"; echo "Issue: " . $row['comicIssue']."<BR>"; echo "Release: " . $row['releaseDate']."<BR>"; } using ->fetchAll(PDO::FETCH_ASSOC) $search->execute(); $result = $search->fetchAll(PDO::FETCH_ASSOC); foreach($result as $row) { echo "Title: " . $row['comicTitle']."<BR>"; echo "Issue: " . $row['comicIssue']."<BR>"; echo "Release: " ....
As the error says, fetch_assoc returns an array, so do print_r($total_quests->getch_assoc()) and see the structure of the array. You propably will have to pick up the first one result, but I suggest you to do it using foreach loop.
objective-c,image,core-data,fetch,photo
Images are stored in Core Data as raw blocks of data. The data is the same as when you convert UIImages to NSDatas. This can result very quickly in a LOT of data being stored in your database, which has to be fetched and de-serialised, hence why it can be...
This is git merge conflict. The remote and local versions of the source files, both have changed the same file. Git marks the change from your local head first <<<<<< HEAD your changes ======= remote changes >>>> You have to edit this file manually and resolve the conflict. See this...
The response must be an array. Each item in the array is turned into a model. Your response is an object. Update your parse method to pull out the values (as an array) from the response into an array and it'll work. MyApp.ItemCollection = Backbone.Collection.extend({ model: MyApp.Item, url: '/api/v1/item/', parse...
If you just want a single value out of the query, then don't use fetchAll() to get an array/list. $pointsfetched = $fetchpoints->fetchObject()->points; Is often the most concise option. (fetch and fetchObject just pull a single row from the result set.)...
Your code is correct.The only thing to do is just remove the first assignment of mysql_fetch_array($result). $row=mysql_fetch_array($result) Just remove this assignment and then run your code.It will work fine....
Have a look at $_SERVER[REQUEST_URI] This will return you the current url. Then process it using simple string or array functions to get the params, like $current_url = $_SERVER['REQUEST_URI']; $url_arr = explode("/", $current_url); Then access the parameters using the array indexes like $page = $url_arr[0];...
php,html,mysql,twitter-bootstrap,fetch
Your select query is not correct. You should use JOIN of mysql. I don't know your database structure. If you show your database structure then I could help you. Please try below query and share the results $sql = "SELECT advertentie.* FROM advertentie LEFT OUTER JOIN categorie on advertentie.categorie_id =...
dynamics-crm-2011,dynamics-crm,fetch,dynamics-crm-2013,fetchxml
I'm not an expert of FetchXML, but I think this query is not possible. This is the CRM explanation: related entity conditions or groups cannot be grouped with the parent entity conditions or group ...
You are experiencing a well known problem, a.k.a. the "N+1 selects". In short, the "N+1 selects" problem occurs when you select a parent entity and hibernate will make additional select for a child related to the parent with OneToOne. So if you have "N" parent-child records in the database, hibernate...
If all your pages are public, i.e. anyone can go to any site at any time, there's only one thing you can do against a bot automatically scraping your site: detect scraping behaviour and throttle it. That means you need to track every visitor by IP address and/or other characteristics...
The type of two variables is different. Try to print type(attivo) to figure out what is the type of two variables. The function fetchall() return a tuple of tuples. So you need to compare the value inside it to 1, not the tuple itself. if attivo[0][0] == 1: print "1"...
I don't believe there is a way to cancel a request with the existing fetch API. There is ongoing discussion about it at https://github.com/whatwg/fetch/issues/27
You are mixing mysql_* and PDO, which is obviously not going to work. Just fetchAll() your results and then just merge all rows into one array by simply looping through all rows with array_map() and returning the id, e.g. $stmt = $DBH->query("SELECT Tid from Playlist"); $result = $stmt->fetchAll(PDO::FETCH_OBJ); $ids =...
java,javamail,imap,fetch,javax.mail
You have to retrieve the same bodyparts for each message. That is, if you want part 1 for messages 2 and 4 and part 2 for message 3, you cannot send fewer than two commands: a uid fetch 2,4 (body[1]) b uid fetch 3 (body[3]) The good news is that...
It won't update because you already have every commit from upstream in your hostory. If you deleted some files and commited the changes that means you are ahead.
You actually have the correct structure down, however the final puts in your method is causing the return value to be nil. Ruby utilizes an implicit return, so unless specified, it will return the last value of a method. remove the puts aspect_ratio from the method, or ensure the last...
c++,visual-studio-2010,visual-c++,curl,fetch
HTTP requests are stateless. You make a request, you get a result, then you make another completely independent request, you get another result, and so on. If the resource you are trying to access is changing over time, you need to make multiple requests, where each time you will get...
android,android-listview,android-asynctask,fetch
Create a new instance of your AsyncTask private void loadSomeData() { MyTask task = new MyTask(); task.execute(); } privat void loadMore() { MyTask task = new MyTask(); task.execute(); } Obviously, there are different ways to do it but that's to give you the idea. What you can't do is create...
Shouldn't you be merging with your local core15 branch? Normally, your local master branch should track the remote master branch. But I guess people have different git workflows. This is what I would normally advise: git fetch git checkout core15 git merge origin/core15 Your essentially sync merging your core15. Then...
This line of the kernel input = tex1Dfetch(tex, idx); is causing race condition among the threads of a block. All threads in a block are trying to fetch value from texture into the __shared__ variable input simultaneously causing undefined behavior. You should allocate separate shared memory space for each thread...
javascript,backbone.js,collections,fetch
If I understand your question correctly, the answer is straight forward. You're not limited to simply saving data in a collection or in the model.attributes hash. Backbone objects are traditional javascript objects and you can create any custom property you'd like. So, in your parse function, you could do... parse:...
php,curl,hyperlink,fetch,offline
<?php include_once('simplehtmldom/simple_html_dom.php'); //set up curl $ch = curl_init('http://example.com'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $curl_html = curl_exec($ch); //use curl to get data from example.com //use simplehtmldom to parse the site into a dom-like object $html = str_get_html($curl_html); echo $html; ?> Here is good example & solution refer this link1 link2 link3...
Wrap the constant in {} to create dynamic variables. echo $rs->{FIELD_NAME}; You can see some example from the documentation. Curly braces may also be used, to clearly delimit the property name. Demo: http://3v4l.org/sgvV4...
Don't use fetchAll and while together. Then: $posts = array(); while ($post = $database->fetch()) { $post['additional'] = 'test'; $posts[] = $post; } Or: $posts = $database->fetchAll(); foreach ($posts as &$post) { $post['additional'] = 'test'; } ...
linux,wget,fetch,ubuntu-14.04,web-folders
Sounds like you are using basic auth. You can pass this to wget with the following syntax: wget http://user:[email protected]/.... ...
android,python,ftp,connection,fetch
ftp = FTP('123.456.7.89:13000', 'username', 'password') The documentation of ftplib suggests that the first argument must be a host, not host:port. This explains also the following error: [Errno 11004] getaddrinfo failed This is an error from the resolver, because it tried to interpret the given name 123.456.7.89:13000 as hostname, IPv4...
jquery,backbone.js,collections,model,fetch
You can combine the requests' promises returned by fetch with jquery.when to synchronize your rendering task. Something like: render: function(){ var that = this, promises = [], user = this.utilisateur, clients = this.listeClient; promises.push(user.fetch()); promises.push(clients.fetch()); $.when.apply(null, promises).done(function(){ that.$el.html(FormTemplate({clients: clients.models, user: user})); }); return this; } ...
<?php if (isset($_GET['id'])) { $con = mysql_connect("xxxx.net","username","password") or die("Connection to server Failed"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("xxxxdb") or die("DB Selection Failed"); $messages_id = $_GET['id']; $result = mysql_query("SELECT * FROM reservation where reservation_id ='$messages_id'"); if($result === FALSE) { die(mysql_error()); // TODO: better error handling }...
php,mysqli,fetch,statements,close
UPDATED: more logical statement $result = $mysqli->prepare("SELECT username FROM user WHERE username=?"); $result->bind_param("s", $username); $result->execute(); $found = $result->fetch(); $result->close(); if ($found){ echo "User already exists!"; } else { $register = $mysqli->prepare("INSERT INTO user (username, password, email, rr, rank) VALUES (?, ?, ?, ?, ?)"); $register->bind_param("sssii", $username, $kode, $email, $rr, $rank);...
The number of records returned by CloudKit is not fixed. CloudKit has a mechanism for deciding how many records to return. It looks like it's currently 100, but it could change depending on the current load on Cloudkit. It is possible to set this to a fixed number on the...
ios,objective-c,core-data,refresh,fetch
I am not sure what your complete setup involves but you do need to implement NSFetchedResultsControllerDelegate protocol methods to dynamically update your tableview cells. https://developer.apple.com/library/prerelease/ios/documentation/CoreData/Reference/NSFetchedResultsControllerDelegate_Protocol/index.html If you are using different managed object context to make updates, you will have to merge those changes as well before they are reflected in...
You need to create a separate table for every type of record you have? Simple enough, if you order your records by the type: SELECT * FROM whatever ORDER BY type_of_record then $previous = null; while(... fetch from db ...) { if ($row['type'] != $previous) { ... got new record...
How about some executing between the preparation and the fetching? like this: $req->execute(); Also i think you want to print the array where you fetched your data in like this: <pre> <?php print_r($article) ?> </pre> So all in all your code should look something like this: <?php try{ $req =...
database,symfony2,doctrine,fetch
Intermediary answer: for now I am using \Doctrine\Common\Util\Debug::dump($article); in order to get the output without problem. Apparently there are extensions that allows to echo the output in a more properly manner. If I find something better I will come back to post it here....
You want to use fetch_all(); fetch_array() returns just one row (as an array) See http://php.net/manual/en/mysqli-result.fetch-all.php This is in fact what the outermost while is doing, fetching one row at a time with fetch_array()...
Your example $this->db->query($somequery, $arrary_replacements); if($this->db->getField("myField") === null){ // Do some stuff // Do some database queries too }else{ $row = $this->db->nextRow(); // Process $row } In my mind, your example usage is flawed. You have already accessed the first row by using getField(), therefore logically, I would assume nextRow() should...
Done some changes to your code according to the example in the docs http://php.net/manual/en/mysqli-stmt.bind-result.php One great thing about parameterized queries is that we no longer (usually) need to escape data, it's done for us :D $sql = "SELECT id,title,description,champion FROM our_videos WHERE datemade BETWEEN NOW() - INTERVAL ? DAY AND...
Always prepare the query Check for the returned values Print errors $nextTicket = $ticket->fetch($thread) is really strange If you query 3 times the same query you doing it wrong. Enable error mode no need for recursion, just loop through the records. function getComments($ID) { $db = new PDO("mysql:host=$dbHost;dbname=$dbDatabase", "$dbUser",...
javascript,google-apps-script,fetch
Your usage of ContentService is correct, the code works exactly as is. Here is a link to my copy of your code published as a web app: https://script.google.com/macros/s/AKfycbzx2L643LHw0oQAq1jBmKQh2ju_znGfmdj78dUypj36iF-s91w/exec The problem you are running into is related to Authorization or Authentication, if the published script is not authorized, an HTML error...
Is this thinking correct? fetch() for one, fetch_all() for many? That's actually two different methods of two different objects. fetch() belongs to mysqli statement object and uses ugly method of assigning query result to global variables. Can be run in a loop. Loop is a thing where you can...
You don't need to require it. It's a polyfill for the browser version, and like the browser version it's always available to the global scope. Take a look at the Movies example and you'll see that fetch is used without explicitly having to require it.
You're using a mysqli DB connection, but calling mysql to do your select. You cannot mix/match the database libraries like that. If you'd had even minimal error checking, you'd have been told that there's no connection to the db: $result = mysql_query($select) or die(mysql_error()); ^^^^^^^^^^^^^^^^^^^^^ Plus, your select query has...
php,pdo,fetch,conditional-statements,fetchall
All the fetchXYZ methods advance the underlying cursor, so once you've called them, you cannot "go back" and get the same rows again. You could redo your condition in-memory, after calling fetchAll() only once: $result = $statement->fetchAll(); if (count($result) == 1) { $result = $result[0]; } ...
javascript,php,jquery,string,fetch
You can do this: $('#result').load('otherPageUrl.php div#currentTime'); See: Example The only problem with this is cross domain restrictions or this will not be possible. The other way you can do this is by the use of iframe....
You assigned the sql query to $sql2 and ran $sql in $connect->query($sql) Correct would be: $sql2 = "SELECT * FROM advertentie"; $result2 = $connect->query($sql2);...
wordpress,function,rss,fetch,autoblogged
Much easier to use WordPress's built-in RSS function. See https://codex.wordpress.org/Function_Reference/fetch_feed Use it as many times as you want in a php template, or make it generate a shortcode. Style the <ul> and <li> and add a containing <div> if needed. Example: <?php // Get RSS Feed(s) include_once( ABSPATH . WPINC...
You are missing loop, data come up. You can see when you are printing data using print_r($fetch), use loop to show one by one. And also try to don't use user input directly in query before checking mysql injection. like you have putted username='qwe' if username is user input then...
add this to your query: ORDER BY RAND() LIMIT 1 ...
You could do this: Get the latest date by splitting individual file names and taking the first element from reverse sorted. From the latest date, get all the files which contain latest date fileList = ['DataLogs_20141125_AP.CSV', 'DataLogs_20141125_UK_EARLY.CSV', 'DataLogs_20141125_CAN.CSV', 'DataLogs_20141125_US.CSV', 'DataLogs_20141125_EUR.CSV', 'DataLogs_20141125_US_2.CSV', 'DataLogs_20141126_AP.CSV', 'DataLogs_20141126_UK_EARLY.CSV','DataLogs_20141126_CAN.CSV', 'DataLogs_20141126_US.CSV','DataLogs_20141126_EUR.CSV',...
Sounds like you want the same format as a querystring, so import/require a package like https://www.npmjs.com/package/query-string which doesn't appear to depend on any browser features and has a stringify method: queryString.stringify({ foo: 'bar', nested: JSON.stringify({ unicorn: 'cake' }) }); //=> foo=bar&nested=%7B%22unicorn%22%3A%22cake%22%7D Alternatively you could just use the relevant part of...
core-data,request,nspredicate,fetch
Found it out myself, anybody who has the same Problem: NSPredicate* predicate = [NSPredicate predicateWithFormat:@"ANY entityName=%@", @"B", selected];...
ios,objective-c,server,fetch,backend
First, you have to create API in ruby. Here is a tutorial on how to do it: https://www.codeschool.com/courses/surviving-apis-with-rails. After that, when you are sure that your API is working correctly, you can write a service for HTTP communication. You can do it by yourself, but in my opinion much better...
It appears that FRED doesn't like non-HTTPS requests. I get the same error you report in Matlab 2015a, but if you change the url to https, it works ok. c = fred('https://research.stlouisfed.org/fred2/'); d = fetch(c,'DEXUSEU'); If you take the url that Matlab is requesting from FRED and paste it in...
You don't have a WHERE clause in the query; it will return the entire table and this is not what you need. More, even if you add a WHERE clause, LEFT JOIN will still return more rows that you need. A possible solution to your problem could be: SELECT p.part_id,...
ios,swift,fetch,nsmanagedobject,nsfetchrequest
With Martin R's help I finally solved my problem. Here is my code from giveMeData method: // entity descritption let entityDescription = NSEntityDescription.entityForName("Contact", inManagedObjectContext: managedObjectContext!) // request let request = NSFetchRequest(entityName: "Contacts") //request.entity = entityDescription // predicate - stanovení parametrů, na základě kterejch to vyhodí výsledek //let pred = NSPredicate(format:...
This was either due to not creating a UIBackgroundTask or using Selene. Using NS APIs solved the issue.
javascript,file-upload,amazon-s3,fetch,react-native
multipart/form-data support for React Native (via the XHR FormData API) for mixed payloads (JS strings + image payloads) is in the works. It should land in GitHub soon.
As you can see in your screenshot the error code is 4 which is a network error See xcdoc://?url=developer.apple.com/library/ios/documentation/CloudKit/Reference/CloudKit_constants/index.html#//apple_ref/c/tdef/CKErrorCode Try switching to 3G or WiFi to see if there is different behavior. If you go to your app settings, is mobile data enabled? Can you run the code from the...
"it groups the data into a single unnamed parameter (changing the API to accept this is not an option)." It would, because you've set the post body. This is how it's supposed to work. I wish to receive the data as two strings that can be parsed as json...
According to your piece of code: correct option name for ngOptions. I didn't see center_navn is an attribute of your center object. working filter. Please provide more details about what the scope variable centre is. Here's working plunker: http://plnkr.co/edit/Q8jhdJltlh14oBBLeHJ9?p=preview...
javascript,backbone.js,fetch,reset
Instead of calling reset before your fetch, a better way to do this would be to use: collection.fetch({reset: true}); As per the Backbonejs docs, "When the model data returns from the server, it uses set to (intelligently) merge the fetched models, unless you pass {reset: true}, in which case the...
arrays,json,backbone.js,model,fetch
I will suggest you to change a few things in you code and read more about Backbone.Model and Backbone.Collection and how REST-ful resources behave themselves. Try to use Backbone.Collection when you are dealing with the collections of objects or so called resources (from REST). And mention appropriate Backbone.Model to that...
nhibernate,fluent-nhibernate,fetch,eager,istatelesssession
I would say: Do not use StatelessSession. It does not suite to this use case. 13.2. The StatelessSession interface Alternatively, NHibernate provides a command-oriented API that may be used for streaming data to and from the database in the form of detached objects. A IStatelessSession has no persistence context associated...
Okay, I found out after reading on the Mozilla Developer Network a bit more and trying out the credentials option. Looks like the credentials option is what I should have looked for. fetch('/something', { credentials: 'same-origin' }) // or 'include' Will send the cookies....
javascript,meteor,settimeout,fetch
You are trying to get the BusinessContact property of an array - try doing userTags[0].BusinessContact PS: Try to make a meteorpad.com when posting a problem...
jquery,ajax,caching,backbone.js,fetch
FYI. The solution that appears so far to have worked was to not override the fetch but override the sync and hardcode a string as the jsonPCallback such as below. sync: function(method, model, options){ options.dataType = this.SYNC_METHOD; options.cache = true; options.jsonp = 'callback'; options.jsonpCallback = "onNowCallback"; return Backbone.sync(method, model, options);}...