The below code now works but how can I make it so if no results are found it echos a message instead of blank. I think I’ve managed to create a search query for my database. Its only a very basic …
html2canvas save image doesn’t work
I’m rendering a screenshot with html2canvas 0.4.0 and want to save it as image on my webserver. To do so, I’ve written the following function: JavaScript saveJPG.php After the canvas is rendered I can perfectly append it to the HTML body, but saving it on my server result in a corrupted (?) file. …
How to simulate Past-Due status on Subscription
I have setup a PHP script on a cron which contacts Braintree via the API to look up the status of each subscription that we have on file. We then update our local records based on the customer’s subscription status. Because I can manually cancel a subscription from the Braintree control panel, I have be…
How to integrate WordPress search with Google maps?
I am doing a beauty salons website for my client using WordPress. I have created custom post type for beauty salons. Now I need to create a page where user can enter a place for example a city and select number of results or a radius in terms of Kilometers. Once we have the results we need to show all
Catching exceptions from Guzzle
I’m trying to catch exceptions from a set of tests I’m running on an API I’m developing and I’m using Guzzle to consume the API methods. I’ve got the tests wrapped in a try/catch block but it is still …
PDO cannot connect remote mysql server
server A(192.168.1.3) mysql server(5.6.12) port 6603,socket /var/run/mysql/mysql.sock php(5.5.0) php.ini pdo_mysql.default_socket = /var/run/mysql/mysql.sock server B(192.168.1.4) mysql server(5.5….
What’s the best way to validate numbers with comma as decimal separator?
In a Laravel app, I have a form on which I need to validate numbers with a comma as the decimal separator. For the moment, it only works with a point because my validation rule is: What’s the best method : Keep the rule and replace comma with point before validation ? Is there a before_validation observer or …
How to convert accented chars to html in php?
I have foreign language strings stored in utf8. When displaying them, I want them to be transform in such a way that accented chars become their html counterparts, e.g. é becomes é However …
netbeans shows “Waiting For Connection (netbeans-xdebug)”
need help to configure xdebug, for debugging projects from IDE netbeans. These are the features of my components: XAMPP 1.8.2 PHP: 5.4.16 netbeans: 7.3.1 Apache: 2.4.4 (Win32) this is the …
Laravel: belongsTo() relation assume one-to-many relationship instead of one-to-one
I’m having a tedious problem with Laravel’s ORM. I have a model with multiple relationships, like this: Now I can access the template related item in a simple way, like this: And it works out of the bat, because Laravel’s ORM assumes it is a one-to-one relationship and internally calls the f…