Questions tagged as 'mysql'

2
answers

Update with MYSQL PHP

I have this code, but it does not update, and I do not know why. <?php // if ($_POST['accemail'] == "" || $_POST['accname'] == "" || $_POST['accphone'] == ""){ // header("Location: myaccount.php"); // } else // { include ("db_files/...
asked by 28.10.2016 / 12:48
5
answers

limit daily records

I have edited this post to see if I can understand I'm trying to make an insert so that only allows 3 records to enter per date, I mean 2017-02-12, to this date there can only be three records, for a new record you should try another day or bett...
asked by 11.02.2017 / 21:25
2
answers

Collect variable localStorage AJAX from PHP file

My question is whether it is possible to collect a variable in localStorage from PHP without sending it. I intend to collect data in a query where I activate an option in a list and send a form but I want to determine if the user is logged in...
asked by 14.11.2016 / 17:39
2
answers

How to use a Case statement in Mysql?

I have two tables one is the detail of product and the other is the product, the problem lies in that I want to make a left join to bring me the data that are related in both tables, the attribute that must be related is the "Number of Pr...
asked by 19.10.2016 / 19:00
1
answer

Insert records into a table based on the result of a query

I'm trying to insert a new row with some data for each value of a SELECT. I leave the last query that has occurred to me but that obviously does not work: SET @postid = (SELECT post_id FROM wp_postmeta WHERE meta_value LIKE '%barcelona%'...
asked by 14.09.2016 / 02:22
2
answers

Processing of input file in PHP

Good morning. I would like to know how to make my ... <input type="file" name="ent_reg"> Be processed in PHP, or upload the file to my hosting and save the path in MySQL database.    The table in MySQL would be like this       Col...
asked by 18.05.2016 / 07:19
2
answers

Prevent data duplication in mysql

How can I avoid duplicating records in the database? What I try to do is first a registry query. Next I show the code.               /** * Representa el data de los gastos * almacenados en la base de datos */ require 'DatabaseConnection.php...
asked by 16.05.2016 / 20:16
2
answers

Link two tables in MySQL

I'm new with this from the BD. I hope you can help me. The query is between these 2 tables: - line - id_line | region | etapa | line | rel_coord | rel_res _______ _______ _____ ____ _________ _____ 1 | region1 |...
asked by 10.06.2016 / 18:58
2
answers

Problem when saving record in database with PHP7

I am using PHP 7 to enter records in a database. It says "full subscription" but I check my database and I do not have any data saved. Where this error? And how can I solve it? This is my registry.php file <?php $db_host="localhost"; $db...
asked by 22.07.2016 / 22:19
2
answers

How to rename a mysql table in php?

What I want is to rename a table from php. I have tried with this: mysql_query("RENAME TABLE ". $tablaNom ." TO '.$nombre.'") or die(mysql_error()); The previous line renames me the table but it puts a "." in the name and when I want to mak...
asked by 14.07.2016 / 20:15