Questions tagged as 'mysql'

1
answer

How to update my MySQL code for MySQLi?

I have codes that use mysql and need to update to mysqli . I need to make two changes, these being the .php pages that insert the data into the database table and data and also the pages that display the data. How to pr...
asked by 22.01.2015 / 15:24
3
answers

How to check if you have connected to the database?

How do I check if my PHP + PDO code successfully connected to the MySQL database? With the code it works: <?php /* Connect to a MySQL database using driver invocation */ $dsn = 'mysql:host=localhost;port=3306;dbname=bancoservico'; $us...
asked by 24.09.2016 / 20:14
7
answers

How to back up daily Mysql Database?

Is there any free tool, or even a script ( .bat ) that I can use to make an automatic backup of my database? > I would like this backup to be generated by saving a single file .sql .     
asked by 31.01.2014 / 14:39
4
answers

Difference between the mysql_connect () and mysqli_connect () functions in php

I wanted to know the difference between the two and which one is the best one to use. $x= mysqli_connect("localhost","my_user","my_password","my_db"); $y= mysql_connect("localhost", "my_user", "my_password"); Are some of them better or newe...
asked by 11.05.2015 / 18:44
2
answers

What is the syntax for doing array searching as a parameter in MySQL?

What is the correct syntax, if possible, to pass an array as a parameter, using FIND_IN_SET more or less on this idea: SELECT c.cpf FROM tbl_cliente as c WHERE FIND_IN_SET(array, c.cpf);     
asked by 09.01.2014 / 14:38
2
answers

Delete multiple rows dynamically with PDO?

Let's say I have a user table ( id | nome ) and that where they are listed (client-side ) I can select multiple of them and delete them at the same time. > How could I do this on a MySQL database using PDO? I know that MySQL allows th...
asked by 20.06.2015 / 22:43
1
answer

What are the differences between utf8 and utf8mb4?

When importing my mysql database into a windows server after I created it on a local server (xampp), I could not import the script I exported from the database into the server. So I decided to copy the table scripts per table, and I noticed that...
asked by 22.04.2016 / 21:14
3
answers

Use VARCHAR (255) for all fields or choose the best size for each field? [duplicate]

Assuming the following fields (for example): Nome , Rua , Cidade , UF . The Nome would be the name of the client. There are people with 2 short names or people with 5 or more names, so it is possible to have a...
asked by 07.05.2018 / 02:11
1
answer

Difference between CAST and CONVERT in MySQL

To solve a problem I ended up with two solutions where in an era the CAST() to convert a number to text, in another era the CONVERT() for the same effect. The two functions, the same practical effect: SELECT (CAST(10 AS...
asked by 05.11.2014 / 21:13
1
answer

What is the purpose of the JSON type column in MYSQL?

I noticed that Mysql has released a new feature, which is the column can be type JSON (which can even be saved in binary, according to what I was reading). Documentation :    As of MySQL 5.7.8, MySQL supports a JSON data type that...
asked by 16.09.2016 / 21:30