Fatal error: Uncaught Error: Cannot use object of type mysqli_result as array - mysqli

I found the line where this problem is, but I don't know what to do with it since I'm not that advanced yet... It's the first line here, can you help me with this, please?
$loginname=$query['username'];
$$info1="upload/".$loginname."/sth1.txt";
$$info2="upload/".$loginname."/sth2.txt";

Where is your mysqli object. Post that code

Related

How can I resolve this syntax error in JPQL?

I am fairly new to JPQL and coming from SQL there are some things I still need to get familiar with, so the problem might be caused by that fact.
Working with the CUBA-Framework, I am trying to create a new entity with a JPQL like a form of projection in SQL and I already have succeeded in doing so but now with another case, I got a syntax error. So here is my JPQL:
SELECT NEW
com.example.vet.entity.vet_AnimalInformation(a.cage,0,0,'test',0)
FROM vet_Animals a
This gets transformed internally into what you can see in the exception below and gives me an error:
An exception occurred while creating a query in EntityManager:
Exception Description: Syntax error parsing
[SELECT NEWcom.example.vet.entity.vet_AnimalInformation(tempEntityAlias,0,0,'test',0) FROM vet_Cage tempEntityAlias, vet_Animals a where tempEntityAlias.id = a.cage.id].
[71, 72] The SELECT clause has 'NEWcom.example.vet.entity.vet_AnimalInformation' and '(tempEntityAlias, 0, 0, 'test', 0)' that are not separated by a comma.
Whyever this restructuring occurs, I can live with that, although in comparison to SQL I feel a lack of influence on the statement here :) somehow the constructor is not recognized as such.
What am I doing wrong here?
Thanks in advance!
edit:
Now I wrote my original SELECT clause in the exact way like it is shown in the error message, after it was automatically rewritten and it works! At least I get another error stating that the constructor with those types of parameters could not be found but at least it is recognized as a constructor.
My guess was then that maybe in rewriting the statement then space between NEW and the contructor gets lost but when I leave that out in my original statement I get a totally different error.

Can not add function to mongodb

I don't know when the problem begin. I find that when i create a new function to mongodb, and then run it like this:
db.loadServerScripts();
testFun('xxx');
Two errors will occur:
SyntaxError: missing } after property list src/mongo/shell/db.js:1038
ReferenceError: testFun is not defined (shell):1
But the old functions work fine. And when I delete one old function, and recreate it without anything changed, it also results in the same error above.
The version of mongodb I used is 2.6.10.
I think I have found the answer to this question. The error was cased by some other function. The error message puzzled me , I used to think that it must be an error from the mongo itself. I delete some mongo function written by me, and then the error was missing. Now I can run testFun successfully.

Why is coffeescript interpreter rejecting 'for' token?

The coffeescript interpreter at coffeescript.org doesn't seem to like the 'for' keyword in any context in which I try to use it, reporting "unexpected terminator" when the 'r' is typed. Anyone have any idea what is going on? I've tried Safari and Chrome on my Mac. The following image shows the simplest example of the failure.
Edit: As noted in my comment on the accepted answer below, it turns out all of the 'for' examples I had tried were incomplete or (unbeknownst to me at the time) invalid.
If you enter a complete statement it will be OK, for instance:
for i in [1..3]
alert i
for on its own is not valid CoffeeScript.

error: 'NSUnarchiver' undeclared (first use in this function)

I have just tried using the NSArchiver but for some reason I am getting this error.
I have downloaded a sample project and get the same error too.
Could it be something wrong with my installation?!
Thanks
Shouldn't you be using NSKeyedUnarchiver?

What does "error: redefinition" mean? and how do i fix it?

I got this error twice. it says "error: redefinition of '-[SampleTableViewController tableView:cellForRowAtIndexPath:]'"
You probably have the method '-[SampleTableViewController tableView:cellForRowAtIndexPath:]' twice in your project (file) and the compiler can't decide which one to pick.