Questions tagged as 'mysql'

2
answers

UTF8 in PHP MySQL connection

I have a PHP PDO connection with two databases, however, I'm having problems with the special characters of both. How to solve? $host = "localhost"; $user = "user"; $password = ""; $database1 = "bd1"; $database2 = "bd2"; try { $dbh1 = n...
asked by 30.01.2017 / 21:58
1
answer

Improved MySql performance (one table or multiple tables) [closed]

What is the best performance (or how best to do) in a MySql database, multiple tables, for example 'customer_business_01, customer_business_02' or a 'customer_business' table with customer ID? Example: I have a system where I can register...
asked by 27.12.2016 / 16:37
1
answer

Generating unique identifier using time () [closed]

I've created an algorithm to generate a handle, which consists of a random value with 24 non-sequential characters. The goal is basically to capture the current time using time() and concatenate it with musical notes (letters 'a' to 'g')....
asked by 11.12.2016 / 18:14
1
answer

Size of a Mysql table with 200 million records

I'm developing a system for a client, and I came across the following situation: it passed me a database, with phone numbers. And I have to create a routine, to generate new numbers for future queries. The table will get about 200 million o...
asked by 15.12.2016 / 00:59
1
answer

PHP error with MySQL [closed]

I have an error and I do not understand why. The error: Fatal error: Call to a member function fetch_assoc() on boolean the error snippet: require 'conecta.php'; $sql = "SELECT 'nomep', 'endereco' FROM 'cadastropn' WHERE 'cida...
asked by 02.09.2016 / 00:08
1
answer

Popular table with data according to input range values

I need to popular some li that form a table, according to the data put by the user in the input range, for example if the user choose 200,000 I would like to return 3 tables with suggestions of a plan of 200,000 a plan above and one below as an...
asked by 31.08.2016 / 01:27
1
answer

PHP function only works on the first call

I'm calling the same php function, in which I pass as a parameter a result of the database, twice in the script but it only works on the first call. I noticed that if I call the function that returns the result of the query and move it to ano...
asked by 12.08.2016 / 22:37
1
answer

How to consult abbreviated words or not without differentiating them, such as RUA and R.?

The user enters as search "STREET STOP". But in the Mysql database it can be saved as "R. Do Stop" or just "STOP". How to optimize this search to get the best result, or the closest?     
asked by 29.09.2016 / 22:34
1
answer

How do I handle Variables in PHP?

I have the following PHP code: Array: $eqCodigos = $_POST["eqCodigo"]; Treatment Attempt to write to MySQl $eqCodigo1 = explode("\n", $eqCodigos); $eqCodigo2 = array_filter($eqCodigo1); $eqCodigo = trim($eqCodigo2); Query mys...
asked by 23.09.2016 / 14:49
1
answer

query query mysql autocomplete

I'm developing an app and in one of the steps I'm using a mySQL database to store code and product information. When the user enters the product code in an input field, he is searching the entire code, but would like it to search exactly as the...
asked by 14.01.2017 / 02:48