Questions tagged as 'php'

2
answers

How to make a JOIN between two tables from two different databases?

I have the personal data (login, password, name, etc.) of the users on a different server than I will use in a new project. I would like to know how I can cross-reference information between two tables, from databases on different servers, with...
asked by 05.02.2014 / 22:04
2
answers

Include within class and access to $ this, self or static

I found this little code inside the Composer/ClassLoader.php folder, in a project where I use composer . /** * Scope isolated include. * * Prevents access to $this/self from included files. */ function includeFile($file) {...
asked by 22.07.2015 / 15:06
1
answer

Galton Board - Central boundary theorem

The reason for this is study / learning. To know / apply programming techniques and concepts, transforming something "material" into "application". I received a video on WhatsApp, where mixed colored balls were separated by colors passing...
asked by 13.04.2018 / 19:47
4
answers

What are Try / Catch Blocks for and when should they be used?

I've been looking for some explanations on the subject, but I have not found any that are simple and straightforward. My question is: What are Try / Catch Blocks for when they should be used?     
asked by 15.04.2015 / 15:18
3
answers

What are the braces {} in a SQL string?

What are the {} keys in the following SQL string used in PHP for MySQL? $sql = "INSERT INTO {$table} ({$fields}) VALUES ({$placeholders})"     
asked by 28.10.2014 / 18:23
5
answers

How to invert dates in PHP, regardless of format?

How to invert dates in PHP? I need to invert dates in PHP regardless of the input format, either YYYY-mm-dd or dd/mm/YYYYY .     
asked by 18.06.2014 / 15:59
2
answers

Collect Google Analytics data for MySQL tables

I have seen many examples of how to export data from Google Analytics to other formats, as well as keep the exported data updated, but none have so far served to export the data to MySQL because of the following problems: Exceeding query l...
asked by 08.04.2015 / 13:34
3
answers

Check if a table exists in the database

How to check if a table exists in the database before attempting to use it? <?php // define a tabela $table = 'banana'; // verificar se tabela "banana" existe aqui // $tableExists = ?? // executa consulta se existir if ($tableExists) {...
asked by 16.01.2014 / 14:11
5
answers

Function refactoring to remove punctuation, spaces, and special characters

I have this function too old to "clean" the contents of a variable: Function function sanitizeString($string) { // matriz de entrada $what = array( 'ä','ã','à','á','â','ê','ë','è','é','ï','ì','í','ö','õ','ò','ó','ô','ü','ù','ú','...
asked by 22.12.2013 / 17:08
3
answers

Comments weigh?

Reviews weigh? I leave comments throughout my code, will influence something on the site? I'm saying more specifically in HTML, CSS, JavaScript, PHP.     
asked by 19.04.2017 / 14:04