Questions tagged as 'mysql'

2
answers

Select with group by

I want to group the results that have the same name(varchar) and count the value(int) of the different key_id(varchar) . Example, if the records were these: Theresultswouldbethese(rememberingthatthekey_idvalueis"random...
asked by 09.10.2017 / 09:59
1
answer

Error in sql-insert command when passing variable as parameter (python 3)

I am trying to pass my "table" variable to the mysql command, however it is returning an error (from sql) during execution. What am I missing? Here I created the variable table table = input ('Table name:') while(tabela not in tabelasCad...
asked by 28.09.2017 / 21:53
2
answers

INNER JOIN with equal fields in a table - Error: # 1066 - Not unique table / alias: 'tb_user' [duplicate]

I have 3 tables as follows: Intb_user,Ihavetwotypesofusers(buyer,seller)inanENUMfieldtodifferentiatetheusertype.IntheshoppingcartIhavetheuserIDs,product,andtransactionnumber.Ilink2timestotb_usuariotoknowwhoboughtandwhosold.IwanttoperformaS...
asked by 27.11.2016 / 19:33
2
answers

SQL Filter (Result that should not appear)

is the following I'm creating an online schedule and I need to list them and show the schedules that are not scheduled, to show the free time. And for this I created the scheduling_table, where in the column schedules_fixes the list of schedules...
asked by 18.10.2016 / 16:10
3
answers

How to insert in mysql using foreach? [closed]

Hello, I have a code where I get the data coming from a webservice and I save it in variables. I would like to Inserir/Salvar this data in my database MySQL . However I get this data through a foreach(){...} // Pegar os leads...
asked by 01.02.2017 / 13:59
2
answers

Change Mysql data in PHP

I have Tb_workers where it is filled out by a form. And then I created another page to change that data. Change.php      $id = $exibe["id"]; $Nome = $exibe["Nome"]; $Morada = $exibe["Morada"]; $Tipo = $exibe["Tipo"]; $Email = $exibe["Em...
asked by 18.02.2014 / 10:09
4
answers

Sort a SELECT in MySql by a letter

How can I make a SELECT query in MySQL that sorts the results and initially presents those that begin with a specific letter? Ex with the letter P: Paulo Patricia (1st ones starting with the letter) Filipe (2nd those with the letter in the mi...
asked by 01.08.2018 / 21:29
2
answers

Convert seconds to minutes

On the base date it records the seconds online of each user, but it gets type numbers (example): 23631. I would like to convert these numbers in minutes, how do I do it? <?php $userstats_a = mysql_query("SELECT * FROM user_st"); while($oi =...
asked by 04.09.2017 / 19:55
3
answers

Select 2 related tables and 1 unrelated query

I have this query down which returns me data from two related tables. It takes all vehicle fields and all product fields with "id_transfer" the same $cmd = "SELECT p.*, v.* FROM produtos AS p INNER JOIN veiculos AS v ON p.id_vei...
asked by 24.02.2015 / 21:05
1
answer

Popular table with HTML table data

I have a table with 4 columns (name, proof1, proof2, dummy). Suppose you are a teacher, and you want to post student grades. I'll give you the following: // $l representará o número de linhas que existem $l = -1; // $inst2 carrega: SELECT nom...
asked by 31.10.2014 / 21:43