I need the default behaviour (i.e ENT_COMPAT | ENT_HTML401) of the PHP-function htmlspecialchars() in C, how is this done best (that means fastest) in C? I don’t need the input string, therefore an in-place solution is possible. It is a really simple function, it just converts these characters: What str…
Tag: php
PHP executes but doesnt execute SQL update correctly
I have a table which displays -Staff ID (Primary Key) -Staff Name -Staff Position All the data loads in to my grid, the grid has an update button witch should let me to update it but it returns …
How to store a array in a database?
I am trying to learn php databases and I have a question. How do I store an array in a database? I saw an answer on stackoverflow and there were they doing something with type double and in an other answer they were talking about creating a table for every user but I can’t find a solution. So summarized…
Laravel 5 Eloquent appending relationships to JSON on multiple levels
So it is pretty easy to include relationships on models such as: when there’s a get request to the user resource, it will include associated roles automagically. But in this setup, the role resources returned with user resource also includes it’s own included relationships like: This generates hug…
Make error for OpenSSL when compiling PHP from source
I’ve attempted compiling both PHP 5.3.10 and 5.6.7 from source on Ubuntu Hardy x86_64 (I know, it’s old). Below is the configure statement I used: But am getting an issue when issuing the make command: This works perfectly fine and I can compile/make/make install when I do not include the –w…
ZF2 Doctrine2 repository result as array
I have the problem, that I have two controllers. One is a restful controller which only handles json data and returns a JsonModel, and the other one is a default controller which returns a ViewModel Now I have the problem, that my method only returns an array of entities, which is correct for the default cont…
SQLite3 (PHP Fatal error: Call to a member function exec())
I’ve been innstall and add conf: I have installed the necessary components and added to the configuration file line, maybe in php.ini need to add something? Answer Unless Im missing something your protected $_db may never get set so you cannot call exec() on null. It will never get set if this does not …
How to keep the previous uploaded image (in db) after submitting a form without selecting a new image to be uploaded
I have a simple form for creating an article: Title,image,category,body , etc.. My problem is with the image input. Selecting a new one and submitting everything works fine: the image is being uploaded to the server the title of the image is being saved to db and i can print it in the article. By editing the …
Laravel 5 and PHPMailer
Does anybody have a working example how I can work with PHPMailer in Laravel 5? In Laravel 4 it was quiet simple to use but the same method doesn’t work in L5. Here it is what I did in L4: Added in …
While loops for server-sent events are causing page to freeze
I am currently working on a chat that uses Server-Sent Events to receive the messages. However, I am running into a problem. The server-sent event never connects and stays at pending because the page doesn’t load. For example: I expect that every 3 seconds, “data: This is the message.” will …