Questions tagged as 'sql'

1
answer

How to get LAST_INSERT_ID () from a mysqli_multi_query () function with SET and INSERT?

This is my 'method' of Placing Bets on my betting system. In this method, I register data in two tables, a BET call and another BET_MATCHES, the system is controlled by time, so in all the registers I need to set the TIME_ZONE = '-03: 00' to...
asked by 24.05.2016 / 21:06
1
answer

Parameterizing value to be Encrypted in SQL Query

Currently, the query query that returns results is as follows: SELECT nome, email, senha FROM Professor WHERE email = ? AND senha = HASHBYTES('SHA1','" + senha + "') p.setString(1, email); When trying to parameterize the value within...
asked by 23.04.2016 / 19:02
1
answer

Insert apostrophes with variables

I'm doing a query through a value stored in a variable. This variable is declared DECLARE @it_codigo varchar(max) and gets value of a ntext field from another table, through a procedure. SELECT * FROM anaProdutos WHERE cod_produt...
asked by 19.04.2016 / 14:24
1
answer

Connect to SQLServer using Windows 10?

I'm using Windows 10 and I have to connect to a SQLServer 2000 database using the command line in a java application. But I'm getting an error. run: ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver SQLException: No suitabl...
asked by 25.04.2016 / 14:04
1
answer

PHP Fatal error: Call to a member function initBD () on a non-object

Hello, I have the following php code function updateRecord($email, $score){ $sql = "UPDATE record set record = $score where email = '$email' "; $banco-> initBD()->exec($sql); //O Log indica o erro nessa linha if($banco->rowCount()...
asked by 17.04.2016 / 03:25
1
answer

Filter data from multiple sql columns

I need help with a database, it would make a distinct with several columns, for example: andtheoutputwouldbe: Would you like to do this on the sql server? Thank you in advance     
asked by 15.04.2016 / 09:09
0
answers

Enter data by PHP

After submitting the form I do the following: $n_processo = $_POST['n_processo']; $nome = $_POST['nome']; $dia = $_POST['dia']; $mes=$_POST['mes']; $ano = $_POST['ano']; $data = $dia."-".$mes."-".$ano; $cc = $_POST['cc']; $cu...
asked by 10.04.2016 / 20:40
2
answers

Best way to get data from a query

I've presented a database table with information from a database like this: <? $sql = mysql_query("SELECT id, nome FROM pessoas"); //---------------DADOS------------------------ while($row = mysql_fetch_array($sql)) { ec...
asked by 11.04.2016 / 01:17
1
answer

How to select all the tables that contain the field with the same name?

I need to look up all the "id_category" fields in a particular database, and bring up a list of tables that contain this field in common, which in this case is the foreign key of the "sis_category" table.     
asked by 08.04.2016 / 21:36
1
answer

Friends System with PHP [duplicate]

Hello, I would like to know how to create a friendships system for my facebook-style application. I'm not making a social network, but I need to implement that system. I have a table of users where I store data like id and username of the r...
asked by 09.04.2016 / 19:23