Questions tagged as 'mysql'

1
answer

How to get the most characters stored in a column of a table?

I have a table products where the column code is a TINYTEXT . When trying to create a foreign key ( FOREING KEY ) I get this error:    # 1170 - Column BLOB column 'code' used in key specification without key size...
asked by 16.02.2018 / 17:06
2
answers

Sentence for an inner join to two fields in a table

I have Tables A and B. In B I have two fields that contain the Ids of A to make relationships in a php report. However I run into a problem: that I can not do a INNER JOIN to show those two fields; TABLA-A id Nombre ===============...
asked by 24.02.2017 / 16:39
1
answer

PHP DataTables Error

Hi everyone, I try to use dataTables with Php, from Mysql data, but I get the following error:    DataTables warning table id = example1-Request unknown parameter '0' for row 0 This is my code <table id="example1" class="ta...
asked by 03.03.2017 / 18:38
2
answers

how can I make this inquiry?

How can I make a message in the table account instead of a 0 ? $notification_info = mysql_query("SELECT count(*) as cuenta from notification WHERE viewed='viewed_no_$uid'"); if (mysql_num_rows($notification_info) == 0) {...
asked by 10.03.2017 / 18:08
2
answers

MySQL using LIKE

I'm trying to get the data from the empleados table that have ape1em starting from a to l , only that it does not show me any. select nomem, (numhiem+2) as invitaciones, numhiem as obsequios from empleados where ape1...
asked by 05.02.2018 / 19:44
2
answers

How to perform a delete with in (select)?

I have the following query DELETE FROM abono where id='dos' in (select * FROM abono WHERE id='dos' limit 2,1) but my mysql tells me #1235 - This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' my table is c...
asked by 27.03.2018 / 05:18
1
answer

How to limit one entry (purchase) per user?

This code is the action of a purchase form, I want only one user to register a purchase. Here in the code if you have not bought anything, your ID will not be in the table tickets so you can add the information, however if your ID was already ad...
asked by 20.06.2018 / 20:54
1
answer

How to connect and display data from a database in PHP

I want to connect a database to a PHP page, in another that I have it works well, but it is this I need to connect and show inside the echo. I have this that I use in another page: <?php $conexion=mysqli_connect('localhost','user...
asked by 27.06.2018 / 01:42
1
answer

How to return the user to the main page if they are not logged in or close the session

I need to know how to get the user returned to login.php if he does not have the session started. This is my code: login.php <?php // Include config file require ('connection.php'); if (isset($_POST['usuario']) and isset($_POST['contras...
asked by 27.01.2018 / 03:24
1
answer

Is it good practice to create relationships in this way? [closed]

I give you a graphic example of what I am implementing, and I would like to know if this is a good practice. I explain. a customer can make many payments, but in turn a partner can also make payments, then, would he have to make a payme...
asked by 16.01.2018 / 16:18