My code looks like this:  $hostname = 'myhost.com'; $database = 'heading'; $username = 'me'; $password = 'pw'; $dbh = new PDO("mysql:host=$hostname;dbname=$database", $username, $password); $dbh-&gt;setAttribute(PDO::ATTR_EMULATE_PREPARES, false); $dbh-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql = "SELECT * from mytable"; $result = $dbh-&gt;query($sql)-&gt;fetchAll(PDO::FETCH_ASSOC); //var_dump($result); //This works and dumps the array with the right data header('Content-type: application/json'); echo json_encode($result);   This echos nothing back though. No errors, just nothing. If I try echo($result) this echos "Array".   What's happening here?
I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.
Passing list to viewparams variables in GeoServer SQL views? I have a sql view which take only one parameter, but this parameter is a list, and a need to know how can i pass this parameter in the url  Here is my sql view  SELECT * FROM shop WHERE id IN %list%   When I put the default value for %list% as (1, 2 ,3) as example, the layer preview works and show the shopa with the default ids,  but when I try this in the url  viewparams=list:(1,2,3)   does not work.   I already tried other things like   viewparams=list:"1,2,3"   but nothing works.  Does anyone know how to do this? Why do electrons not fully fill up all the orbitals sequentially? Why do electrons not fully fill up all the orbitals sequentially? By this I mean: why don't the electrons fully take up the previous orbit first and then move onto the next orbit? Take calcium for example, it's electron config is 2, 8, 8, 2. Why isn't it 2, 8, 10? Why does another orbit need to be created when there are still many spots to fill up?  (I know that this is a chemistry question in a physics forum, but I really could not find a chemistry or even a broader science type forum here ) What are the restrictions on the use of Slayer's Prey? In the recent book Xanathar's Guide to Everything, there are some subclasses/archetypes added for Rangers, among them the  (p. 43), which gives some specific helpful features. Hunter's Sense  At 3rd level, you gain the ability to peer at a creature and magically discern how best to hurt it. As an action, choose one creature you can see within 60 feet of you. You immediately learn whether the creature has any damage immunities, resistances, or vulnerabilities and what they are. If the creature is hidden from divination magic, you sense that it has no damage immunities, resistances, or vulnerabilities. You can use this feature a number of times equal to your Wisdom modifier (minimum of once). You regain all expended uses of it when you finish a long rest.  The limitations on use are clearly spelled out. Slayer's Prey  Starting at 3rd level, you can focus your ire on one foe, increasing the harm you inflict on it. As a bonus action, you designate one creature you can see within 60 feet of you as the target of this feature. The first time each turn that you hit that target with a weapon attack, it takes an extra 1d6 damage from the weapon. This benefit lasts until you finish a short or long rest. It ends early if you designate a different creature.  So from this, I would interpret it as it being able to switch from creature to creature at will, but there is no guidance as to what happens if the creature under the mark dies, or if you can carry it (so to speak) from encounter to encounter. Is there a limitation on the use of Slayer's Prey in the wording that I am missing? Or is this a basically a multiple use feature? (i.e., you can designate any creature as a bonus action, with no limitations on uses per day)? The extra d6 seems a little overpowering at lower levels, and somewhat meh at higher levels. FWIW, the GM basically allowed it as multi-use for the session, and was going to also try to find clarification. Remove linux version 3.19.31 Having trouble indexing and executing a query in O (log n) time.  The query includes an INNER JOIN, an ORDER BY, and an equality operation. If I understand the laws of databases correctly, a query can be indexed and executed in O (log n) time (or thereabouts) if a non-equality operator is not used on more than one column. In this case, I believe the INNER JOIN does count as an equality operator and the non-equality operator would be the ORDER BY portion of the query. This table has upwards of 10,000,000 rows and needs to handle several reads and writes per second.  Using PostgreSQL. This is what the table looks like. As you can see, the column 'Names' is a list property and it is the column that the INNER JOIN goes against:  Age Names                       Date 34  ['carla', 'john', 'sam']    3/13/2011 26  ['json', 'cindy', 'joel']   3/13/2011 72  ['beth', 'amber', 'susie']  3/13/2011 14  ['john', 'jim', 'debie']    3/13/2011   This is the query that we are trying to do:  SELECT * FROM the_table WHERE Age==26 AND Names=='john' ORDER BY Date   My background is from using App Engine's Big Table, so I've used equality operators here to indicate that 'john' should be one of the names in the Names column. This would be an acceptable query in GAE's big table, it would execute in O (log N) time as all Big Table queries are reqyured to do. I am assuming there is a way to do this in PostgreSQL as well since PostgreSQL accepts list data types as columns.  Is this possible to do in PostgreSQL?  If so, how should the index be set up (we can't figure out how to set up an index that takes into account the three properties)? It may be something that will happen to the person who is having the feeling but it may also be to several persons, as might occur with a highly destructive earthquake, for instance.   The word or phrase would be used in the following sentence:      “I’m no spiritualist but I have a feeling of ___. I hope it’s just a feeling."   EDIT - The phrase I'm looking for conveys a much stronger feeling than "I have a bad hunch". It is about something catastrophic which the person feels is "going to happen in a few minutes". What is the difference between standard i386 download and the amd64 download of Ubuntu 11.04? I am currently running the i386 on an amd machine, would my system work better with the amd64 download instead? (my machine was running Windows 7 64bit, but I neglected to look at that prior to installing Ubuntu). What did Bill do to make Hanzo mad? During kill Bill, we learn that all the black mamba had to do to get Hanzo to build her a sword, was to mention Bill's name.  When black mamba meets Bill at the end, she tells him that all she did was mention his name. Bill responds with, "that'll do it!"  So what was it that Bill did to Hanzo to make him come out of retirement and make another weapon of death? Given: $\operatorname{gcf}(x,36)=9$ and $\operatorname{lcm}(x,36)=108$. Find $x$.   p.s I tried $54$ but although the $\operatorname{lcm}$ of $54$ and $36$ is $108$ the GCF is $18$ and it has to be $9$. Help me please. Storing datetime values in Shapefiles using QGIS? I have a shapefile with date in a string field. I create a new field with date type and use the calculator to make the conversion. But the result only provide the date part, the time part is removed. Even when the preview show the correct conversion.  Here you can see the original string field time and the result date time2. And the use of the conversion function to_datetime() and the preview result at the end    If you go to the layer properties you can change the edit mode to date/time. Then if go to the data and try to edit time2 you get the current date/time. So is possible save date and time in the same field. But the update tool still doesn't work as expected      As J.R said. Even when you can change QGIS edit to allow Date/Time the save to shapefile will discard the time. An example for a homomorphism that is not an automorphism Integer squares of the form $x^4+x^3+x^2+x+1$ I want to solve ${y^2}=x^4+x^3+x^2+x+1$ in $\mathbb{Z}$.    I can find four solutions. Is there another solution? I know that there are six solutions. $$(-1, \pm 1)\;,\;(0, \pm 1).$$  My try: \begin{align}   &amp; x^4+x^3+x^2+x+1=0\quad \Rightarrow \underbrace{\left( x+\frac{1}{x} \right)^2}_{t^2}+\underbrace{\left( x+\frac{1}{x} \right)}_{t}-1=0\,\Rightarrow t\notin \mathbb{Z} \\   &amp; x^4+x^3+x^2+x+1={\pm 1}^2\quad\Rightarrow \,x=-1\,\,,\,x=0.\\  \end{align}   Thanks. Identify a story about a teen boy who learns to use magic with his lizard companion HTML text input allow only numeric input Is there a quick way to set an HTML text input (&lt;input type=text /&gt;) to only allow numeric keystrokes (plus '.')? If A and B play a game with a fair coin such that A wins by getting consecutive TT for the first time, while B wins by getting a consecutive TH.  Who has higher probability of winning the game?   I tried the following method but not sure:  For A to win,     TT, HTT, HHTT ... that is, 2-k for each game length k   For B to win,     TH, HTH, HHTH ... that is, 2-k for each game length k   So ultimately I am getting same probability of each to win. How do I declare a 2d array in C++ using new? A company is any form of business whether it is small or large. Generally the term &quot;company&quot; indicates a particular kind of business dealing in a specific product. An organisation is the larger form and generally comprises of a number of companies.  Simply, a company is an organization, but an organization is not just a company. An industry is the combination of companies in same line of business. Firm, corporation and business  are synonyms of &quot;company&quot;. An Agency is a particular kind of company, which serves as an intermediary between clients (other companies or individuals).  Is this correct? What is an example of a transformation on a posterior distribution such that the MAP estimate will be non-invariant? Suppose that we have a posterior distribution $p(\theta\mid y)$ and we wish to define a transformation on $\theta$ such that $\phi = f(\theta)$. I know that generally such transformations will not affect the MLE as it is on the data space, but will result in non-invariance on the Maximum A Posteriori (MAP) estimate as it is a function of the parameter space. I am wondering if there is an example to illustrate this? Thanks. WinForms DataGridView font size How do I change font size on the DataGridView? This was a 'young-adult' SF novel I read in the late 1970's, about the same time I was reading Voorloper by Andre Norton, Madeleine L'engle's Wrinkle In Time books and the Dragonfall 5 young adult novels. so I am not sure if it is actually one of the Dragonfall 5 stories, but I can't confirm it is or isn't by reading available synposes online.   As I recall, the story went something like this...    * SOME SPOILERS BELOW *  A young person and sibling - I think female protag and younger brother, but not sure - is scheduled to visit their aunt and uncle on another planet but to make the voyage in a timely fashion, must utilize this new consciousness transference technology to transmit their consciousness across the cosmos to a host replica body at the destination. After arriving at the destination the protagonist is impressed by their new body and is aware of the only way to tell they are in a replicant body is a small seam, scar or patch on their back, I think near the top of their spine, just below the collar of whatever clothing they wore.  The mystery begins when the protagonist realizes their hosts also sport the same scar when they should legitimately be in their real bodies.  The plot thickens when the protag or sibling finds a room of people in stasis when their replicant counterparts are roaming the same planet, and is subsequently caught in the act.  Sadly, I do not remember anything else, including the reasoning behind the deception.  I was quite young when I read this novel, so I probably got some of the details mixed up, but would love to know the name and author of the novel if anyone remembers.