Questions tagged as 'mysql'

1
answer

PDO does not return count

I need to store the result count, but apparently with the PDO I can not store the value. I have already circled the select out and come the result, why can not I store the result $flag in the variable? $query = "SELECT COUNT(...
asked by 14.12.2015 / 16:30
2
answers

Get records of 3 tables with JOIN

I need to get data from 3 tables in the same SELECT. I need only get the user data from the users table, get the amount of quotas (column quantity_cotas) that the user has from the quotas table (if you have registration in that user table) a...
asked by 31.12.2015 / 04:43
1
answer

Is it possible to execute multiple queries in a single execution?

I needed some data from a database in mysql. However, the data were in different tables, so the most obvious solution was to filter using the relational tables, with their indexes. But I do not know much about mysql, I even tried to use the rela...
asked by 29.12.2015 / 21:15
1
answer

Send id in a hidden field when clicking on an autocomplete.js item

I need the client id to be sent to a hidden field by clicking the name of it that is brought by the jquery autocomplete. The autocomplete is already working ok .. what I really need is that by clicking the ID is sent to the hidden field.    h...
asked by 22.02.2016 / 21:32
1
answer

Error collecting value from va_list in C

Good afternoon. I encountered a problem when preparing va_list in c. of two similar codes, one works and the other persists in error. extern bool _sqlite3_insert(const char *table, const char *types, ...){ M_HEADER; // macro com as...
asked by 19.02.2016 / 20:57
2
answers

Get id of the last sale and register in the codvenda field of the items table.

Hello, I have to register the sales made in two tables, (Sale and Item Sales). In the sales table I have the id, codclient, date and total fields. In the itemvenda table I have the fields id, codvenda, quant, price. My question is how t...
asked by 18.12.2015 / 17:59
1
answer

Correct way to send values through PDO [duplicate]

I was informed that I was doing incorrectly, the sentence said was as follows: "It's no use to use a newer API and maintain the old vices of mysql_* , you should not pass the values directly in the SQL statement, pass them apart using...
asked by 18.12.2015 / 13:25
2
answers

How to verify in the database if the cadastre has already been made PDO

How do I check if id of the user no longer has a record in the database and continue with insert ? if(isset($_POST['submit'])){ $comment = trim(strip_tags($_POST['comment'])); $insert = "INSERT into tb_comment (id_mark,...
asked by 10.12.2015 / 22:46
3
answers

Can I modify a field before performing a search? (PHP MYSQL)

   "SELECT * FROM table WHERE content LIKE '% $ search%'" Is it possible to change the values of the 'content' column before the search is performed? Example:    "SELECT * FROM table WHERE strip_tags (content) LIKE '% $ search%'"...
asked by 13.11.2015 / 01:05
1
answer

How to disable the query cache in MYSQL?

When we use the command SHOW VARIABLES LIKE 'have_query_cache' we can see if the cache is enabled or not. Result: Variable_name | Value ---------------------------- have_query_cache | YES How do I disable this policy? Is there...
asked by 24.02.2016 / 14:06