I just don't understand why there is an error. I briefly took a look to the rewrite. As always, any help is appreciated. If you want to check if the form was posted then you should instead check for: if! Okay So I have managed to fix the two errors that I was originally having problems with. Thanks so much for your help! In case you happen to experience this issue, now you know how to overcome it for good.
So first I just create directory call it libs under app directory and loaded it to composer. The thing is I have used this code before in a similar context. I would like to ask a bit of advice please. You query still won't work, but you should at least get a proper error message which will help solve the problem. I suspect what is happening here is that your data is breaking the query because it probably has quotes and other special characters in there.
On 11 June 2017 this website experienced a serious downtime that was caused by a very odd error occurred within the WordPress database. Firstly, when you try to insert your data, an error is thrown, but when you try to show the error you get another Fatal error because your error reporting is wrong. File and row point to it. When I use queryOne it works just fine, correct answer is printed. Try felgall: what is cryptic to you will probably be obvious to many of the people here. It's quite odd that hosts like yours don't support prepared statements. Actually it's a database abstraction layer since it deals with specifics of multiple databases which means less work for you if you wish to switch from one dbms to another, or need to use more than one dbms.
If you are using a free hosting provider, I suggest using something other than that current one you have. Which I used to solve a problem. I am getting these errors:! This has been suggested a lot. Okay so this is what the code looks like now. When you click on 'Edit' the link in the php is Edit So when I click on 'Edit' it should find the newsid and pull that information out but I can't fathom out why which is why I came to the forum. I've been looking at this script for a while and I can't seem to get it to work. Unless maybe your html markup elsewhere is causing it to be visually hidden.
How do I convert or type cast strings into a different variable type? Just spotted something that might cause you a problem on lines 158 and 168. Thanks for the response Jay. And mysqli has full support for the prepared statements. Using queryone over query would be helpful. So please, at least don't try to sell it here.
Your question title says that your code is using mysqli. I would like to research and see if they do support prepared statements or not. Which made 3 new problems, that I also solved, now there's a new problem, which doesn't make sense, I know why, but I don't know how. . As for which filter to use, you only need to use a filter if it's necessary. I was certain I was editing the correct file. It is the database access you are using that determines if prepare statements are supported not the hosting.
Thanks for the response Nog! May be time to start debugging your code step by step, rather than all in one go. I don't care, I just want to be done with this stupid job. Remove everything apart from the first query and try it. If that works, add in the next query and try that. The error message as shown in the post you have linked to didn't actually show me anything on the screen, just a blank page.
Once you've got the error showing up, post it here to give us more of idea about what's happening. Who is your hosting provider may I ask? Also, what does this error usually stem from? I guess it has to do with declaring the variables that hold these guys. The only 5x version that is still supported is 5. If you look at this one there aren't really any major differences that I can see yet this one works and actually displays the form populated by the database information for the user to edit. I tried to switch the integer to a string, still didn't work. Edit: Full code below: Conversation Already Started! Anyways, I'm not here to argue. I would suggest you remove the filters altogether, and then sort out the error reporting.
I've managed to get rid of the 'undefined index' error by changing this in the 'Edit News' page from this: To this: However if anyone can please help with the second error I would be very appreciative! I feel like this too is. May be you don't like the prepared statements yourself or your host is lying to you, but from your question it is obviously evident that you have full support for the prepared statements. I didn't realize a query returned an object. Makes it worse since 000webhost is free and supports prepared statements and they're running on 5. Your solution has brought to me to think about something.
For example we have 'Car'. Removing that doesn't fix the problem, but rather just removes the error display and the script fails regardless. My stupid host doesn't support prepared statements, and finding good free hosting is pretty tough for presentation. So, start examining all those places where you embed variables in string literals, or otherwise convert them to the string type. Either it's not getting a value, or it's getting a bad value, or maybe it's getting an id that just isn't in your table. You can keep telling me to turn on the lightbulb, and I can keep telling you we're in Middle Ages.