Questions tagged as 'mysql'

1
answer

Help with return in SELECT

$user = $_SESSION["usuario"]["id"]; $sel = BD::conn()->prepare("SELECT lk.*, ep.* FROM gostados lk INNER JOIN episodios ep ON...
asked by 06.01.2017 / 16:21
1
answer

Save duplicate arrays in an Insert

Have duplicate arrays produto[] valor[] qtd[] total[] produto[] valor[] qtd[] total[] I need to save these arrays in an insert, like this: INSERT 'tabela' (produto, valor, qtd, total) VALUES (produto[],valor[],qtd[],total[]) ; INSERT 'ta...
asked by 05.01.2017 / 03:27
1
answer

Which constant declare in PDO :: PARAM_ to insert date (yyyy-mm-dd h :: m: s) in mysql?

I need to pass a date to the database. I will use the class PDO, but I have the following doubt. At the time of creating the "bindValue ()" what kind of constant should I declare in PDO :: PARAM_?     
asked by 06.01.2017 / 01:47
1
answer

How to convert varchar to datetime?

How to convert a date in varchar to datetime in the mysql ? For example: 04-12-2016 to 2016-12-04 16:00:00 04/12/2016 to 2016-12-04 16:00:00     
asked by 06.01.2017 / 21:17
3
answers

Change a select based on the selection of another select (from data in the DB)

I have the following problem: In a form, I need to make a selection of a MANUFACTURER, and according to this selection, it will display the PRODUCTS bound to that manufacturer only. I have the following table where I register the MANUFACTU...
asked by 05.01.2017 / 17:40
1
answer

GROUP BY - Display grouped result using WHERE as condition in same table - MySQL

I'm trying to set up a query to fetch results in a table where I need to determine a condition for one column, group for another, and display a third. The database is composed of 6 tables, 5 of which are queried individually, containing: i...
asked by 04.01.2017 / 00:08
1
answer

Add item with different array

I have the following array () Array ( [nome_responsavel] => [telefone] => [email] => [dependentenome] => Array ( [0] => qqq [1] => qqq [2] => qqqq )...
asked by 10.01.2017 / 21:21
1
answer

How to pass a controller variable to view?

I need to pass the multiple $ limit to my view and display it there, how could I do that? public function index() { // .... $this->pagination->initialize($config); $data['pagination'] = $this->pagination->create_links()...
asked by 24.01.2017 / 22:02
1
answer

ENTER key save table instead of space

I have the following table that lets you edit directly on the grid: Hercodes:  MySQLtableCREATETABLEIFNOTEXISTS'php_interview_questions'('id'int(8)NOTNULL,'question'textNOTNULL,'answer'textNOTNULL,'row_order'int(8)NOTNULL)INSERTINTO'php_inte...
asked by 20.01.2017 / 12:53
1
answer

Select with subquery

I have the following select: SELECT id_usuario, SUM(CASE p.tp_honorario WHEN 'Mensal' THEN (h.vl_honorario * 12) ELSE h.vl_honorario END) as valor FROM empresa_honorario as h INNER JOIN honorario as p ON p.id_honorario = h.id_honorario WHERE...
asked by 07.12.2016 / 12:14