Questions tagged as 'mysql'

1
answer

Functions of PHP adapted to MySQL

When trying to optimize some queries to not depend on PHP to do something that could come ready from the database, I was trying to adapt the two routines below into functions > from MySQL: function encode( $input, $index ) { $base...
asked by 14.07.2016 / 17:12
1
answer

Create database via command line and overwrite existing

I have a function (Delphi) that creates processes and executes BAT files that do, for example, backup of a MySQL BD, like this: "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqldump.exe" -u root -proot BD > "C:\dbbackup.sql" Is there a...
asked by 02.06.2015 / 03:36
1
answer

Do SELECT between two tables in PHP

I'm currently using the following query to select all saved posts in the database: "SELECT * FROM postagens ORDER BY id DESC LIMIT 7" , however, I want to select only the posts made by "friends". The relationship of friends is in...
asked by 20.11.2015 / 23:39
1
answer

Rest API and Sessions, how does Login work?

I've always worked with PHP / MySQL and Javascript / jQuery. I've always connected PHP with the database directly, and I use sessions to log in. I'm currently working on a project where I use AngularJS for the frontend and PHP / MySQL for the...
asked by 08.12.2015 / 21:32
1
answer

Primary key field from int to bigint

Well I need to turn my primarykay fields from int to bigint, but it's giving a problem. Here is the code below: Executing SQL script in server ERROR: Error 1025: Error on rename of './DB_ATOS542/#sql-b4b_210' to './DB_ATOS542/tbl_PESSOAS' (err...
asked by 02.12.2015 / 18:01
1
answer

See if SLUG already exists

I would like to know how I can query if a SLUG already exists in the database and, if it exists, how to increment +1 to the end of the string, site.com/artigo/titulo-de-teste1 site.com/artigo/titulo-de-teste2 site.com/artigo/titulo-de-t...
asked by 06.12.2015 / 17:56
0
answers

Monthly shift schedule

I have to create a button in php for when I click generate a monthly shift schedule, but I'm not sure how to do it. Can anyone suggest an idea? What I am thinking is to randomly choose the collaborations I need per day of each shift, but it i...
asked by 08.01.2018 / 18:41
1
answer

play button plays another audio

I have a table named posts , and there is a post_aud column where a text is inserted with the name of the audio / music (which is 'saved' in the audios folder) ... $get_posts = "SELECT * FROM posts ORDER by 1 DESC"; $run_posts = m...
asked by 15.12.2017 / 04:11
2
answers

Validate xml file before updating database

I have a file upload system that when sending the xml file it sends the inserts and updates to the database, but if I send a file with the different structure I get errors. I have already found some solutions using DTD and # How can I ensu...
asked by 11.03.2015 / 03:43
2
answers

Simple log editing with PHP + MySQL

Basically the three scripts should edit a record in the Database: records.php: <?php // Aqui você se conecta ao banco $mysqli = new mysqli('127.0.0.1', 'root', '', 'login'); // Executa uma consulta $sql = "SELECT 'user_i...
asked by 26.02.2015 / 20:40