Questions tagged as 'mysql'

2
answers

Add product value for purchase

Well, guys, I have the following difficulty, I have a very simple sales panel: AsyoucanseeIhaveacomboboxwithsomeproductsinit,myproblemandthefollowingIwouldneedassoonasIchoseanyoftheproductsthere,automaticallyinVALUEitisrecordedinmytable,andifin...
asked by 30.12.2015 / 19:13
1
answer

Doubt with Bank column

I got a mysql dump to study and I was left in some text column with the fields filled in this way: 'a:5:{ s:9:\"user_data\"; s:0:\"\"; s:4:\"nome\"; s:5:\"admin\"; s:2:\"id\"; s:1:\"1\"; s:9:\"permissao\"; s:1:\...
asked by 02.11.2015 / 01:36
1
answer

Get image name in mysql for id

I would like to know how to get the image name by user id, I have this bd: I would like to display only the image of the claudiomiro, and not all of those in the bd ... this way: Ihavethiscodetouploadtheuser/password/name/image,theimageis...
asked by 24.10.2015 / 22:46
1
answer

Help with php and json

I'm having trouble displaying correctly in JSON , a result from two tables in my database. The situation is as follows: I have requests in a table (A) and the products of that request in another table (B). The JSON result I have is l...
asked by 13.10.2015 / 16:00
1
answer

Error trying to execute PDO Insert function - PHP

I'm trying to create a PDO function to execute two inserts, one after the other, but I'm having trouble. The function code is: public function double_cad(array $dados){ $pdo = parent::getDB(); $double_cad = $pdo->prepare("insert...
asked by 24.10.2015 / 16:08
2
answers

Picking the wrong id when selecting line with CheckBox

In this script I loop the rows of a table, where each row contains a checkbox and hidden inputs. The problem is that when I select a line with the checkbox, the values corresponding to the checkbox come correct plus the other inputs come as t...
asked by 07.10.2015 / 22:18
1
answer

Is it possible to reuse this complex function for multiple entries at the same time?

In the site that I assumed from a previous developer, one registers investors one by one after a system search called CM. The function is called cadastraInvestidor: function cadastraInvestidor(codigoCM){ // TODO 2/4/2015 - Cadastro de investid...
asked by 07.10.2015 / 16:06
1
answer

write files to the database with ajax + jquery

I am not able to save data in the mysql database with ajax, can anyone help? Not from error or anything, just does not save. PHP:      $serve = mysql_connect('localhost', 'root', ''); if(!$serve){ echo 'erro';} $db = mysql_select_db('observato...
asked by 03.10.2015 / 20:41
1
answer

Correct way to return the number of results using CodeIgniter

I wrote 2 possibilities to return the number of results using CodeIgniter, as follows: public function get_num_indicados($id_usuario) { $query = $this->db->query("SELECT count(id_patrocinador) as num FROM usuarios WHERE id_patrocinad...
asked by 04.11.2015 / 23:17
2
answers

Bring select on a line with 2 references

Good afternoon, I would like to know if there are possibilities to bring everything in a row with the following tables: Pedidos id id_produto1 id_produto2 id_produto3 Produtos id produto I wanted to make a select that brings the orders t...
asked by 05.11.2015 / 16:04