I am trying to connect to server in NetBeans. I write the code as below: Running of this code return this erreurs: Answer MySQL can be configured to not accept external connections, for security reasons. By saying the full domain name, you are using the public IP and therefore you are an external connection. …
Tag: php
PHP image upload function, save in a dir and then return save image url
I am trying to upload an image to server using PHP and the save inside a dir, and then returning the image url. HTML: PHP save_string_to_database( …
cakePHP value for empty option
is there a way to pass a value for the empty option in a select dropdown generated by the FormHelper? I’m creating an input like this: echo $this->Form->input(‘supplier_id’, array(’empty’=>true)); with values supplied automatically from the controller like this and the s…
PHPUnit assert no method is called
I have a ClassA that uses a ServiceB. In a certain case, ClassA should end up not invoking any methods of ServiceB. I now want to test this and verity no methods are indeed called. This can be done …
Symfony2 Process component – unable to create pipe and launch a new process
I’m using the Symfony2 Process component to manually manage a pool of processes. In the example below I restart 2 simple processes every 2 seconds and monitor what happens. The application breaks after restarting these processes a few hundred times. Execution is stopped and I get the following PHP warni…
Access, transpose, and join data from a .csv file
I have a CSV File which is laid out as so: My code: This produces three strings, which are needed to plot a graph. However it is likely that I will be adding more columns to the csv file, so I need a way of looping around to avoid having to manually add new lines each time. I cannot seem
How to rename uploaded file before saving it into a directory?
Below is the code I used in order to upload files into a directory. It works fine. My main question is: move_uploaded_file() is the one that saves the uploaded file into the directory, and it is also my guess that move_uploaded_file() is the one that sets the name for it. How could I change the name of my fil…
Get live NFL scores/stats to read and manipulate?
I need some sort of database or feed to access live scores(and possibly player stats) for the NFL. I want to be able to display the scores on my site for my pickem league and show the users if their pick is winning or not. I’m not sure how to go about this. Can someone point me in the right
Display WordPress Site Title
I want to display the Title of my WordPress Site on the single blog posts pages. I use the following line of code in my theme’s ‘single blog post.php’ However it does not show anything. Answer You are not outputting anything to show. You are only assigning blog name to a variable. You need t…
Laravel or where
Currently I am working on a project in Laravel but I am stuck.I want to create a SQL statement like this: Now I have this code: But that generates: How can I get the correct “or” order? Answer Check out the Logical Grouping section in the docs: https://laravel.com/docs/master/queries#logical-group…