Questions tagged as 'php'

1
answer

Transform mysql query into list

I'm doing a query on a database that returns a list of users, which I'm printing to a table. I would like to turn this query into a list and then insert those users into another table I make the query as follows: $sql= mysqli_query($con...
asked by 29.01.2016 / 13:26
1
answer

How to identify the type of request sent to the server?

I do not want my ajax.php page to display anything when accessed by the user's browser. AJAX.PHP<?$nome=$_POST['nome'];$email=$_POST['email'];$senha=$_POST['senha'];if(!$nome){echo'Escrevaseunome!';}else{if(!$email){echo'Escrevaseuemail!'...
asked by 23.07.2015 / 20:08
1
answer

How can I add elements in a multidimensional array?

How do I add elements to a multidimensional array. For example instead of creating an array in PHP like this: $i = 0; $aArray[$i]['title'][] = 'teste'; $aArray[$i]['link'][] = 'teste de link'; Being able to do so $aArray[$i] = array( 'tit...
asked by 27.07.2015 / 18:07
1
answer

Index and automatic values

I have the following Json: {"result":[ [ {"ID_CTE":"1","ABREV":"301CAGSP","MODELO":"CT","NUMLANCTO":" 71","NUMCONHEC":" 5911","NUMFATURA":"0000173","NUMREMET":"23.643.315\/0094-51","NUMDESTIN":"23.643.315\/0110-06","NUMRED...
asked by 28.07.2015 / 20:43
2
answers

List every month in Query or PHP?

I need to list every month within a period, including the ones that did not move, for example: My Query: SELECT LEFT(B8.B8_DTVALID, 06) AS VALIDADE, SUM(B8.B8_SALDO) AS VENCIDO, 0 AS VENCENDO, 0 AS AVENCER FROM SB8030...
asked by 22.07.2015 / 22:25
1
answer

Generate menu and submenu with PHP

Location: I am building a menu with information submenu that I retrieve from the database, these data are categories and subcategories of products, this menu is ready and working, but when there are no subcategories (which is a submenu of t...
asked by 27.07.2015 / 16:20
1
answer

Number of elements in JSON

How can I find out the amount of elements of a json file through PHP. See my example file: [{"descricao":"Fotografia","codigo":784},{"descricao":"Filmagem","codigo":789}] I would like to check the amount of elements, which in this case s...
asked by 08.06.2016 / 19:26
2
answers

Update date by adding in bank

Good morning, guys. I have in my database DATE fields for 'start date' and 'end date', so I can search at intervals. When I imported this data some dates were empty or non-conforming and were not recorded correctly. I would like to know: i...
asked by 14.06.2016 / 13:27
1
answer

How to group dates coming from an array?

I have a function here to do and I do not even know where to start: I have an array of dates to group: array (size=12)<br> 0 => string '2016-08-22' (length=10)<br> 1 => string '2016-08-23' (length=10)<br>...
asked by 14.06.2016 / 20:27
1
answer

if only execute else

Hello everyone, I have this function if it collects a variable coming from login.php and does a check to choose between two menus. But it does not matter the result inside the variable $permt it always chooses else. Someone can poi...
asked by 09.06.2016 / 02:23