Posts by Jhonny Freire • 196 points
14 posts
-
0
votes1
answer81
viewsA: How to store a foreach variable inside an array
I don’t know if I can understand exactly what you need, the question is too vague. But I believe you want to store students in two different classes. If so, in your code you are replacing the values…
phpanswered Jhonny Freire 196 -
0
votes1
answer26
viewsA: I can’t use "use Pdo"
You don’t need to put as PDO on use. Use only use PDO; You put to only when you will use in the function but not declared in use, for example: <?php // sem declarar no use class Qualquer { public…
-
1
votes1
answer106
viewsA: Sorting the contents of an Array
I have made a small process to help you, it is certainly not the best way but it may be your starting point in this ordination. <?php // Dado o array inicial $arr = [ [ 0 => '5522 8600 0000…
-
2
votes1
answer89
viewsA: Jquery autocomplete UI with PHP returns only whole words
When using the LIKE operator to search for parts of the text you need to inform a 'joker', in the case of Mysql and in most relational databases you can use % as a joker. For example, to search my…
-
0
votes1
answer39
viewsA: Location of a variable
In this syntax, the Slug parameter is mandatory and since there is no route to /noticia the expected is actually 404 as return '/noticia/{slug}' To make it optional you need to use the following…
-
0
votes1
answer89
viewsA: How to copy the contents of a table to the clipboard
Good night Lucas, I believe the code below can help you, I did the example using the Clipboard API (https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API) <html> <body>…
-
1
votes1
answer48
viewsA: Email php error , I can not at all
This error happens because you are trying to use $this out of a class, recommend you search over PHP and object orientation to understand the use of $this. Also to use the mail function in Windows…
-
1
votes1
answer1040
viewsA: There is no active transaction error
It turns out you’re calling the commit even if the rollback happens. When you commit or rollback the transaction ends, so the error you mention. I commented on these points in your code and then…
-
0
votes2
answers60
viewsA: How can I ensure that my API will only be used for the features I want it to use?
One possibility is to use a multi-tenant or multi-tenancy strategy, in this approach one of the methods is to separate the data of each company in different databases but using a single application.…
-
1
votes1
answer85
viewsA: Urls accumulating in DJANGO
I don’t know Django but you can try: <a href="/index">Inicio</a> <a href="/login">Login</a> instead of <a href="index">Inicio</a> <a…
-
3
votes1
answer1264
viewsA: Send text via php using my phone number
To do this you will need access to SIM, which PHP does not, at least not natively. What I already some people doing is developing an app for android, for example, and send it through the device and…
-
0
votes2
answers224
viewsA: Is there a paid localhost server?
As colleagues have already said, programs like Xampp, Wamp and etc are 'pacotões' of programs like PHP, Mysql and Apache. Of these the Wamp is the one that has the friendliest interface, just access…
-
0
votes3
answers1239
viewsA: SELECT with 2 tables and same field in both
In the future, you can improve your application by leaving this data in only one table, because as I understand the structure of the tables is the same, you can create a field to indicate the type…
-
0
votes3
answers524
viewsA: Count without using rowCount from PDO
If you are using Mysql you can work around the situation using sql_calc_found_rows and found_rows(). Here is a link to an article that makes use of these resources.…