Questions tagged as 'php'

2
answers

Make a conditional UPDATE on the ON DUPLICATE KEY

I have a query that receives data from a .csv and inserts the data into the table. If position is the same it updates the fields. I need to verify that position is different from 1 ( status ) in order to update. This...
asked by 19.11.2014 / 03:18
1
answer

Know line and file that is executing a method

I want to know if it is possible to know the line and file that a method is executing. For example, I have a class Log , with it I make log records of the users. Log.php <?php /** * Classe de Logs */ class Log { var $con; pr...
asked by 06.01.2015 / 20:00
3
answers

Increase letters in PHP?

Recently I needed to increment letters in PHP within a loop repetition. For each iteration, instead of numerical indices, it needed letters of the alphabet. So, as I already know that PHP does incremental letters (and to be very simple), I...
asked by 04.02.2015 / 20:40
1
answer

COUNT and GROUP BY in two columns

Personal I am facing a question with a particular Query, I have already cataloged everywhere on the subject but without success. If there is another way to do what I'm trying, I'll thank you for the information So, I'll illustrate the scena...
asked by 19.11.2017 / 08:12
1
answer

How to format the day of the week so that no symbol appears in PHP

How to change the symbol that appears on Tuesday by a Ç ? Mycodebelow:<?phpsetlocale(LC_ALL,"pt_BR", "pt_BR.utf-8", "portuguese" ); date_default_timezone_set('America/Sao_Paulo'); echo ucwords(strftime("%A ")); $dt = date...
asked by 22.08.2017 / 17:14
2
answers

Error in isset PHP

It's giving you an error when I use isset with new PHP methods: <?php require './fb.php'; if (isset(filter_input(INPUT_SESSION, "fb_access_token")) && !empty(filter_input(INPUT_SESSION, "fb_access_token"))): echo "Ta logado!"; e...
asked by 16.10.2017 / 18:58
1
answer

How do I change everything to a single php value

My question is this: In a table, I have a column named nomecliente . In this table I have several records, however the column nomecliente of the records are different from each other. How could I make a mysql_query UPDAT...
asked by 29.07.2016 / 21:34
1
answer

PDO with Emulated prepares is insecure? What's the difference?

Recently I did some research on the internet and noticed that several people say that PDO does not protect 100% against injection, specifically with emulated preparations. If possible, someone gives me an example of SQL that would pass the PDO w...
asked by 09.09.2016 / 20:41
2
answers

How to transform the first array of a multidimensional array into a key?

How can I transform the first array of a multidimensional array into a key? for example this would be my multidimensional array array (size=5) 0 => string 'Nome' (length=4) 1 => string 'd_r_A' (length=5) 2 => string 'numero' (le...
asked by 18.08.2016 / 21:30
3
answers

Return on methods

Colleagues. I have a class where my methods that contain arguments, but have no return, I usually put the following code at the end: public function metodoRetorno($valor) { // ... return true; } But in methods that do not have (v...
asked by 08.11.2015 / 14:53