Laravel 5.1 - return eloquent model with multiple relationships

PHP
I have the following models Show, Presenter, Image.Shows can have multiple presenters. Presenters have one image.I can do this to get a presenter with...
1 year ago

codeigniter and ajax autosave doesn't work

PHP
I have a timer let's say 60 minutes and I want to save the timer every 1 second interval. My code is working perfectly locally but when I uploaded onl...
1 year ago

PHP merge array on nulls

PHP
I have 2 * array and I want to merge them, but each of theme have some NULL rows.$a = array( 'a' => NULL, 'b' => 1, 'c' => 1);$b = a...
1 year ago

Get the index value of an array in php

PHP
I have an array:$list = array('string1', 'string2', 'string3');I want to get the index for a given value (i.e. 1 for string2 and 2 for string3)All I w...
1 year ago

Prepared Statement with variable array

PHP
I have an array of fields I possibly want to look for in my DB:$locations = array( 2,3,5 );The number of locations can differ, and I want to...
1 year ago

Including typed.js in wordpress

PHP
I have been trying to add a typed.js plugin to one of the wordpress themes.I put the typed.js in the "js" folder in the theme folder.Then I edited the...
1 year ago

Passing a variable using .getJSON for conditional SQL Query

PHP
I have a page that generates a table and its content will be retrieved using .getJSON. But i have a variable to be passed for that conditional query. ...
1 year ago

How do I run 3 foreach statements, after passing a condition?

PHP
I have three functions: showActiveAdverts(),getActDefault() and getDefaultBanner() and I want to run through all using a condition.Here's my code:<...
1 year ago

explode() doesn't separate a string by spaces?

PHP
I am attempting to open a text file and explode the list of names within into an array but when I var_dump the new array I get this:array(1) { [0]=&gt...
1 year ago

Array element without index when var_dump()?

PHP
When I var_dump($_SESSION['qty']), I got this:array(3) { [0]=> int(2) [1]=> int(1) [""]=> int(2) }May I know what this [""]=> int(2) means...
1 year ago

php exceptions - can we have multiple throws?

PHP
if ($disponivel === 0) { $razao = $check->cd->reason; $mensagem = "the domain isn't available. Reason: ".$razao; } el...
1 year ago

Select data by status column in laravel 5

PHP
IN Custom php code$select_query = "select * from admin where Stutes = '1' order by ID asc";How we can embed this code in my this laravel 5 codepublic ...
1 year ago

Can we ever determine if the request was sent from another domain?

PHP
I've read these webpages: PHP Form Security With Referer and http://www.mustap.com/phpzone_post_62_how-to-bypass-the-referer-se So basically my quest...
1 year ago

How to integrate PayPal express checkout?

PHP
I'm developing a wordpress plugin that needed the PayPal Express checkout feature. I was following this article from paypal site on how to Integratin...
1 year ago

How to take key value from array?

PHP
I have an array like this. Now I need to create a query based on the key value and value for that key. $array_value = Array ( [0] => ...
1 year ago

How to order with mysql query only products which has biggest price ratio between price and promo_price

PHP
I have this query: SELECT id,bg_product_name,product_price,promo_price FROM products WHERE active="1" order by ((product_price / promo_price) > 0...
1 year ago

Rewrite profile URL with username

PHP
In this code with mod_rewrite I can visit the profile of any user by typing his username after domain like example.com/john this will take us to john'...
1 year ago

JpGraph not able to read fonts

PHP
Usually I am pretty good debugging problems, this one just seems to keep getting around me. I have installed the JpGraph library at /usr/share/php/jpg...
1 year ago

How to show records in php from database in specific order

PHP
I am making a program in php to select records from database in alphabetical order by adding, "order by 'column name'" in my query string for example...
1 year ago

I can't write into database with embebed form in symfony2

PHP
I'm handle embebed form with symfony2 but I have this error: Entity of type GestionResiduos\EmpresaExternaBundle\Entity\Transportista has identit...
1 year ago