Questions tagged as 'php'

1
answer

Set timeout for specific function

I have a multi-function script . I want to set a specific timeout (type set_time_limit ) for a function , and if it pops up, it "disregards" and continue running the loop / script. Example: function teste(){ sleep(10); }...
asked by 18.09.2018 / 20:28
3
answers

How to do multiple inserts at one time?

Well I have 3 tables in my database, and I make a INSERT in the sale table, and as soon as I enter the data in it automatically I would have to insert into the and the vendaproduct table that would be this code: if(isset($_POST['s...
asked by 10.12.2015 / 17:55
0
answers

How to implement a mansory grid and Infinite scroll together?

I'm developing a Pinterest style website but I'm not able to put these two features together. To do the infinite scroll, I used jQuery with AJAX to pull the database posts and append them to the body. I basically copied this formula here: li...
asked by 18.09.2018 / 22:06
3
answers

Is it possible to use the ternary operator in several conditions simultaneously?

Is it possible to use more than one condition at a time when using the ternary operator? <?php if($ativa == 0): echo "Médico(a) Desativado(a)"; elseif($ativa == 1): echo "Médico(a) Ativo(a)"; else: echo "Informação Indisponíve...
asked by 21.08.2017 / 21:44
4
answers

Most common words among rows

Is there a function in MySQL that gives me the 3 most common words between a column in TEXT format of a table? Example Maria Joaquina Maria Antonienta Maria B.     
asked by 30.12.2014 / 00:26
3
answers

How to use static and global variables in PHP?

I need the value of a variable in several functions to be able to increment and decrement the value of the variable. I have tried to use static variable started with null value, but even changing its value, it gets null. How do I manipulat...
asked by 05.02.2015 / 12:55
2
answers

What is the correct way to use the header location? [closed]

I'm doing a PHP and MySQL course on Alura and got to the part where we built the code that removes the product from the database. The page that calls the delete function must redirect the user back to the produto-lista.php page and the...
asked by 14.01.2016 / 19:31
4
answers

I can not concatenate a variable in a query

I have a URL and a code that will vary all the time (Ex: usuario/perfil/39 ). I used the following code to get this value from the URL: $valor_id = $_SERVER['REQUEST_URI']; $cod = explode("/",$valor_id); $codigo = $cod[4]; So I n...
asked by 14.10.2014 / 05:20
5
answers

How to validate phone in php

I'm trying to validate my phone number, both landline and cell phone, and I'm trying to do that, no matter how the user types: 11965453789 (11) 965453789 (11) 965453789 (11) 96545-3789 Always save in the database and show back to...
asked by 03.08.2016 / 23:00
4
answers

Row size too large (8126)

It gave me an error loading mysql data.   Row size too large (> 8126). Changing some columns to TEXT or BLOB or   using ROW_FORMAT = DYNAMIC or ROW_FORMAT = COMPRESSED may help. In current   row format, BLOB prefix of 768 bytes is stored i...
asked by 09.06.2014 / 18:52