Posts by William Okano • 662 points
19 posts
-
4
votes2
answers820
viewsA: An application for multiple customers with Laravel
For your solution you could research on multi-tenancy architecture. I’ve been looking over multi-tenancy in Laravel and unfortunately I haven’t found much (pre-ready). Basically you create a Tenancy…
-
3
votes3
answers1074
viewsA: Add a comma to each word
I would do a little different, use regex to remove the additional spaces. <?php $exemplo = "texto de teste com muitos espaços talvez erros de digitação"; $tags = preg_replace('/\s+/', ', ',…
phpanswered William Okano 662 -
1
votes1
answer35
viewsA: Consult the most duplicated record
If your query already returns the correct data of the amount it teaches you can sort by decreasing QT_DISC (from largest to smallest) and then select (limit) only 1 record. select A.nome,…
-
1
votes5
answers11978
viewsA: How to get the current file name
You can use the DIRECTORY_SEPARATOR constant to correctly detect which bar is used by your operating system for directory separation. As a curiosity, there are other constants, such as…
-
1
votes1
answer1722
viewsA: Select between two tables in PHP
Follow what you wish Creating create table postagens ( id int primary key auto_increment, usuario int, conteudo text); create table amizades ( id int primary key auto_increment, usuario1 int,…
mysqlanswered William Okano 662 -
1
votes1
answer728
viewsA: Curl looks 100% identical to my request using common browser
You are always being redirected to the login screen because you are creating a cookie jar but it is empty. You need to populate Curl cookies with your current cookies. curl_setopt($ch,…
-
2
votes1
answer917
viewsA: How to create an insert Trigger
Trigger is related to the database and not the language. A Rigger is created just to be automatically invoked before or after something. For example, I can create a log for audit, always after…
-
4
votes1
answer36
viewsA: "order by clauses" can create conflicts between themselves?
If I understand your question correctly the answer is no. In the ORDER BY clause, priority is given to whoever is defined first. Explaining using your example: The bank will be ordered using the…
-
4
votes1
answer358
viewsA: Doubt about the socket.io functioning
Yes. The socket.io does nothing more than abstract a websocket connection for you. The socket connection is between the user and the server, so to perform what you will need to do some type of…
-
-1
votes1
answer323
viewsA: PHP and Javascript - File Upload Help
Try it this way: In HTML puts a form surrounding all your inputs <form id="umaIdQualquer" enctype="multipart/form-data"> And in your javascript add this before ajax var formData = new…
-
5
votes3
answers4136
viewsA: How to subtract a date from the current system date
Do it right on Mysql Read about the function Datediff Look at this fiddle http://sqlfiddle.com/#! 9/5b7184/1 that I show you how to use and a functional example almost similar to your table. Just…
-
1
votes2
answers482
viewsA: Avoid permanent connections and Singleton class in a PHP project
If you are using the MVC standard I recommend that you create an Abstract model that will be extended by all other models. In this abstract model you can implement methods like open connection,…
-
12
votes1
answer657
viewsA: Run ECHO without interpreting HTML
Use htmlentities. Ex.: <?php echo htmlentities($row_rs['original']); ?>
-
2
votes2
answers871
viewsA: Listing images within a directory
Best use directory Iterator. $path = "/var/www/html/imagens"; foreach (new DirectoryIterator($path) as $fileInfo) { if ($fileInfo->isDot()) continue; echo $fileInfo->getFilename() . "<br…
-
2
votes3
answers1009
viewsA: Encryption security in php
md5 and sha1 although they are single-handed (cannot be reversed), there are several Rainbow Tables with multiple passwords generated with these hashes. A technique that could be applied would be…
-
1
votes3
answers106
viewsA: show("show") does not work on firefox
$(document).ready(function(){ event.preventDefault(); $("#form").hide("slow"); $("#conteudo").show("slow"); }); At this point you still haven’t set Event (and it doesn’t even make sense that…
-
4
votes8
answers1094
viewsA: Is it recommended to use constants for configuring a PHP project?
Better centralize your data in a configuration file. If you will use with define, or if you will use a . env (dotEnv), it doesn’t make much difference. Just don’t leave it fixed in the code because…
-
1
votes2
answers224
viewsA: Date Filtering - Month Verification 31 and February
You can make a ExtesionMethod for his DateTime, if the date problem is recurring. Example: using System.IO; using System; using ExtensionMethods; class Program { static void Main() { DateTime hoje =…
-
0
votes2
answers247
viewsA: Parse HTML regex problem
You can use this regular expression, I think it matches what you need: balance_unavailable['"]\s+value=['"](\d*\.?\d*).*balance_dispute['"]\s+value=['"](\d*\.?\d*)