Questions tagged as 'mysql'

1
answer

I can not register a record in the database [closed]

<?php session_start(); if(!(isset($_SESSION['usuario']))){ header("location: index.php"); } include './classes/Conexao.class.php'; include './classes/DAO/EmpresasDAO.class.php'; include './classes/e...
asked by 07.10.2018 / 03:51
1
answer

Doubt to count records in a MySQL database query

In a MySQL database, I have two columns of type varchar that brings me records in this format: ["165","184","192","209","242"] One more example: Each number in double quotation marks is a record, that is, it is the ID of some stude...
asked by 25.09.2018 / 20:42
1
answer

What is the correct way to install LAMPP?

I started using Linux (Ubuntu 18.04) recently and I've come across many difficulties. So I tried sometimes to install the lampp stack on Ubuntu and was not successful. There was always some mistake. And I want to know the correct way to insta...
asked by 25.09.2018 / 02:44
1
answer

Receive form in 2 different tables

I have this code to receive data in two different tables. But only the first table is receiving data. The second remains blank. Can this code work this way? if(($query=mysql_query($sqlinsert)) and ($query2=mysql_query($sqlinsert2))){ $sqlinser...
asked by 07.02.2014 / 19:00
2
answers

Update data file

I have a question about changing FILE data. <?php include("conectar.php"); $id = $_GET['id']; $sql = mysql_query("Select* From tb_trabalhador WHERE id = $id"); while($exibe = mysql_fetch_array($sql)){ $id = $exibe["id"]; $Nome = $exibe["...
asked by 04.03.2014 / 17:10
2
answers

Select database items that contain something similar to the contents of an array

Assuming I have the following array array("valor1", "valor2", "valor3", "valor4", "valor5") and I need to get all items from a MySQL table whose column X has a value equal to one of these items, like to proceed?     
asked by 26.07.2018 / 01:19
1
answer

I am having trouble formatting a date, it is in this format Mon Jul 30 2018 00:00:00 GMT + 0000 [closed]

I need to save the date and time in the bank, but the date returns me in this format 'Mon Jul 30 2018 00:00:00 GMT + 0000' and the bank is '0000-00-00 00:00:00', I recorded it in a string and it goes out of shape in the bank '1532995200000', I t...
asked by 14.08.2018 / 00:08
1
answer

importing Xml data to Mysql database - only writes the LAST record

In this code all the XML records are read, but in the Mysql database only the last XML record block is written. I know that reading each record over-writes the previous one but the strange thing is that I gave an ECHO and checked that the foreac...
asked by 08.08.2018 / 17:19
1
answer

Chat using php and msql [closed]

I wanted to know how I can with php get the id of another user online, not by name, because there may be users with the same name. for example pull the id of another user, I do not know how to do this (full beginner)     
asked by 08.07.2018 / 00:03
1
answer

Error adding FOREIGN KEY to table already created [duplicate]

I have a table that needs to be changed to have a foreign key    ALTER TABLE bancocliente.producto ADD CONSTRAINT fk_fabPro FOREIGN KEY   (cod_fab) REFERENCES bancocliente.fabrica (code); I get the error message: Erro SQL (1452): Cann...
asked by 12.07.2018 / 20:50