Questions tagged as 'mysql'

2
answers

How to code a number in PHP

I would like to know how to display a coded number for the user. I have several rows in my tables and I wanted to encode the user IDs. I was looking for functions for this but I only found md5 and sha1 but these generate very la...
asked by 31.12.2014 / 02:10
1
answer

Timestamp automatically update with current date

I would like to know if it is possible to automatically update the value of another TIMESTAMP column called date with the current date and time, similar to% the INSERT function of MySQL?     
asked by 03.01.2015 / 21:00
1
answer

Get rows of at least 3 days ago

I have a table with column datetime and I need to get the results that already have 3 days of existence, all with more than 3 days, I tried to use SELECT *, DATE_FORMAT(date, '%m/%d/%Y') FROM tb WHERE DATE(date) = CURDATE() - INTERVAL 3...
asked by 14.01.2015 / 23:52
1
answer

AJAX sends information to PHP but fails to INSERT only one

See this code for me: HTML: <script type="text/javascript" src="js/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="js/criaEvento.js"></script> <form method="post"> <table width="420" align...
asked by 06.02.2015 / 21:22
2
answers

Problem when comparing hours

In the comparison of schedules I have in the registered database the opening and closing times of an establishment. I'm having a problem when comparing the time to see if the establishment is open or closed, it always appears to me as open when...
asked by 16.02.2015 / 01:09
1
answer

Doubt mySQL and Left Join

I have the following SQL, which returns data that will fill some inputs of a form. The problem is that I have 20 items (pieces) in this table, but it can be empty because the user can fill any amount. The description of the piece is in her table...
asked by 07.03.2016 / 18:30
1
answer

QUERY containing different and or

I need to do a query where the status of that person can be A = Active, I = Inactive and B = Locked but can also be null, my query is already returning when it is A, B or I but when it is null no returns nothing. select COD_IDENT_PESSO,...
asked by 24.03.2016 / 12:09
1
answer

Apostrophe causing error when inserting data in MySQL

I am a beginner in PHP and I am creating a personal project to consolidate my knowledge until I came across a problem, when entering a name that has an apostrophe this apostrophe causes INSERT INTO not to execute causing the data are not...
asked by 09.03.2015 / 17:24
2
answers

Getting information from the database without refreshing the page

I have a system in which it takes information from the database. And this database is getting direct data, so I wanted to know how to get this data and display it on the page, but without this page being updated. This system is in php.     
asked by 12.06.2014 / 16:24
2
answers

How to make rounding every 5 tenths (0.5)?

I have a select that returns the average of the columns. I used the Round to remove some decimal places and round the numbers. The possible numbers of the fields are integers from 1 to 5, and when the average is selected, the decimals appear....
asked by 11.06.2014 / 16:50