Questions tagged as 'mysql'

1
answer

How to insert an array of unknown size into the database?

I'm trying to insert multiple rows with data coming from an array into the database. I've never done anything like that, since I always insert one line at a time. What am I doing wrong?     
asked by 09.06.2018 / 16:45
1
answer

How should I structure my database?

I'm studying MySQL and I have a user system. When the user logs into the account, he or she can create notes. I imagine the table of the user straight, but what about the notes? Should I create a table just for them and use foreign keys? What do...
asked by 06.06.2018 / 07:47
1
answer

How to collect the activity execution time performed in the database without executing directly in mysql

I need to get the runtime of several inserts, updates, alter tables between other activity I do in the database, I know that if I did it right in mysql it would return to the end of the operation, but I am executing a script in js for Ba...
asked by 03.06.2018 / 21:52
2
answers

PHP syntax error when inserting an image

I am inserting an image into the database with the following code $nome_img = $_FILES['imagem']['name']; if(move_uploaded_file($_FILES['imagem']['tmp_name'], "images/Produtos/".$nome_img){ $query= "INSERT INTO produtos(ImagemProduto) VALUE...
asked by 08.06.2018 / 13:02
2
answers

Insert row in MYSQL without leaving the page (using PHP)

I have a system of downloading songs with a download button and I would like that when I click the button, it inserts a line in the database without leaving the page. Now what I did is open a new page that does the insert: For each song ha...
asked by 04.06.2018 / 16:23
1
answer

Make a select with 3 tables and return in table 3 the records of the id of the first [duplicate]

I have 3 tables, the first is occurrence, second is the individuals and third vehicles. The tables individuals and vehicles I made subforms of occurrences. I have the first key in the instance id_current, the other tables I have the primary ke...
asked by 07.05.2018 / 22:22
2
answers

How to join 4 tables in one and show text instead of INT - INNER JOIN

Hello, I know it's more or less like this in 2nd print and with the Inner join but I'm not getting it. I'm using MySQL Workbench and more when I finish this I want to move to C #. I have this question, I have already joined the 4 tables...
asked by 28.05.2018 / 17:42
2
answers

How can I not reserve the same Equipment for the same day and time?

I am doing a code of Equipment Rental in Php, in general the code is almost all finished, but in the last step I came across a big problem, I wish the adm, since it is he who makes the reservations, not you can reserve the same equipment twice f...
asked by 30.05.2018 / 02:16
1
answer

Where is the error? I can not pull table from the database!

function getUserAccessRoleByID($id) { global $conn; $query = "select user_role from tbl_user_role where id = ".$id; $rs = mysqli_query($conn,$query); $row = mysqli_fetch_assoc($rs); return $row['user_role']; } function...
asked by 20.10.2018 / 22:22
1
answer

PHP Insert image in the bank Mysql Xampp

I'm trying to insert an image into the MySql bank via PHP , actually its path, after moving the picture to a folder in the root. I'm using xampp. All the codes I tested normally insert the other form data but not the image. Does any...
asked by 20.10.2018 / 14:16