Questions tagged as 'mysql'

1
answer

What is the correct way to save an IP in the database?

How to save both types of IP the IPV4 and IPV6 in a MySQL database? What is the correct typing and column size? Any other comments? I get the IP through $_SERVER['REMOTE_ADDR'] with PHP.     
asked by 25.10.2017 / 17:05
1
answer

How to display number of records per category in PHP and MySql

I have a table of real estate in MySql divided into 6 categories. I want to make a query that returns the number of records for each category. The only way I know so far is to do a query for each category, but I think this requires a lot from th...
asked by 26.10.2017 / 00:39
0
answers

Problem saving month - MySQL Workbench

Good afternoon, I am doing a project management project and I have in the registration form, two date fields, when I enter, when I consult the bank, the dates appear with the wrong month, all indicate month 1. This is the save button code:...
asked by 16.10.2017 / 20:07
1
answer

Function inside sql server

I'm trying to make a function inside the sql server, however, I can not use it because an error appears saying that the result is more than one line (Error Code: 1172 Result consisted of more than one row) I can solve this. 'CREATE FUNCTION 'r...
asked by 02.11.2017 / 15:43
0
answers

How to make a routine of sending certain data from one MySQL database to another

I'm a beginner and enthusiastic web developer. I'm trying to develop a system that works basically like this: I have a registry of contacts, only running on localhost (PHP and MySQL) - because I need a system that works even when the machine...
asked by 10.10.2017 / 21:13
0
answers

SQL does not return all records in the table

My application consists of an html page in which the user informs the code of a product, the quantity, and it is shown below. Behold, if I add a product, it is inserted, but it does not return. And when I continue to add items, only the followin...
asked by 11.10.2017 / 03:21
0
answers

Call to a member function method () on string

I'm using CodeIgniter and, when trying to do a search in my database to see if a given line actually exists, it displays the Call to a member function checarId() on string error. Here is the code for the functions that return this error:...
asked by 07.10.2017 / 21:26
2
answers

PDO Insert Record

I'm having issues with the insert tag in the database with PDO , below it follows tabela and script : table calendar CREATE TABLE 'calendar' ( 'id' int(11) NOT NULL, 'title' varchar(255) CHARACTER SET latin1...
asked by 08.10.2017 / 15:48
2
answers

Switch case on submit button according to button ID

I have 7 submit buttons on a form. Being: Four of that: <input type="submit" id="chamado1" class="mr-abre-btn" value="Abrir chamado"> Two of these: <input type="submit" id="chamado2" class="mr-abre-btn" value="Encaminhar chama...
asked by 19.10.2017 / 22:20
1
answer

Create database through PDO

I have a project in mind, in which I would like to create a database with the name of variables, and in case it would be checked to see if the DB was already created, it would look something like this: if ($pdo=new PDO ("mysql:host=localho...
asked by 09.10.2017 / 17:08