Get The Time In Php For Chat

PHP
UPDATE: I fixed the problem. $date = new DateTime(null, new DateTimeZone(date_default_timezone_get())); $date->setTimeZone(new DateTimeZone('Amer...
1 year ago

how to insert data to table by store procedure with session value?

PHP
This is a stored procedure in mysql database. I tried mysql_query($connection, "CALL xyz") but shows me error. by store procedure I want to insert d...
1 year ago

Retrieve exit status from php script inside of shell script

PHP
I have a bash shell script that calls a few PHP scripts like this. #!/bin/bash php -f somescript.php php -f anotherscript.php I want to compose a...
1 year ago

Doctrine DBAL setParameter() with array value

PHP
I'm using doctrine DBAL and have some problem with SQL query as result of a queryBuilder. $builder = $this->getConnection()->getQueryBuilder();...
1 year ago

JSON Array to MySQL Database

PHP
I'm working on a project that involves a PHP script that calls an API and gets a JSON array. I then want to put this JSON array into a MySql database...
1 year ago

Laravel 5.1 Multiple Many to Many Relationship on the Same Model

PHP
I seen to of got tangled in Laravel's ORM with the following: Scenerio: All Users have a Watchlist, the Watchlist contains other Users. I can't seem...
1 year ago

php - Form item not being posted

PHP
Here's the relevant snippet of my form <form action="viewtickets.php" method="post"> <label for="ticketid">Ticket:</label&...
1 year ago

Add url extensions to Laravel routes

PHP
Is it possible to add an extension to laravel routes like so? http://www.mywebsite.com/members/login.html and another page with a different extensio...
1 year ago

How to find the Dominant color in image?

PHP
i want to find the dominant color in image, how can i do it ? it would be great if i can get this in HEX code (exm: #eeeeee)
1 year ago

PHP: XPath query returns nothing from large XML

PHP
$newstring = substr_replace("http://ws.spotify.com/search/1/track?q=", $_COOKIE["word"], 39, 0); /*$curl = curl_init($newstring); curl_setopt($curl, C...
1 year ago

php function called by onchange of html select

PHP
I am learning about php functions and I am having trouble with assigning a new value to a key in a session array based on the users change to a select...
1 year ago

I thought one did not have to pre-define arrays in PHP

PHP
So, I created an array, by manually adding each entry: $Sections[] = "A.1.4.1";//900 0 900 0 900 900 888 800 800 913 900 900 900 $Sections[] = "A.1.4...
1 year ago

Define a constant function call

PHP
My code is like this: <?php define("ERROR", "SOMETHING WRONG WITH MY DATABASE"); ... if (!mysql_query($q)){ die(ERROR); } ?> Now I want to...
1 year ago

Symfony2: manual file upload with VichUploaderBundle

PHP
How can I upload file with VichUploaderBundle without form? I have file in some directory (for example web/media/tmp/temp_file.jpg) If I try this: ...
1 year ago

PHP mail linebreaks

PHP
I have a php mail script that works just fine as long as I define the body text in a var like this: $body = "Some text goes here\n\nSome other text g...
1 year ago

PHP Session always working

PHP
I've got an if statement to check if a variable within the $_SESSION is active and set, and if it is then a message is returned to the user. Here's my...
1 year ago

xdebug installation not working

PHP
so I added the following line to php.ini: zend_extension="Z:\wamp2\bin\php\php5.3.0\ext\php_xdebug.dll" xdebug.remote_enable=on xdebug.remote_handler...
1 year ago

Laravel: Get base url

PHP
Simple question, but the answer seems quite hard to come by. In Codeigniter, I could load the url helper and then simply do echo base_url(); to get...
1 year ago

PHP passing a class name becomes a string when passed to a function

PHP
Here's what I want to do: public function all($model) { $query = 'SELECT ' . implode(', ', $model::$fields) ....; } Called like this: $thing-&gt...
1 year ago

Wordpress Define Variable Plugin

PHP
I'm attempting to create a plugin for a site in Wordpress for both practice and execution. In this plugin will be a variety of files. I want to define...
1 year ago