Questions tagged as 'mysql'

2
answers

Return with json array showing only first record

<?php //database configuration $dbHost = '127.0.0.1'; $dbUsername = 'root'; $dbPassword = ''; $dbName = 'master'; //connect with the database $Mysqli = new mysqli($dbHost,$dbUsername,$dbPassword,$dbName); $arr = a...
asked by 11.04.2017 / 14:54
1
answer

Help with field to save a link

I need to save a link in the database, which in the case is MySQL, I was using VARCHAR (255), but I easily noticed some of the stored links exceeded 255 characters, what kind of data can I use in the database to store this information? I believe...
asked by 17.04.2017 / 02:50
1
answer

How to get the current date minus two years in mysql?

I need to show in a query some items between the current date of the time in question and two years before.     
asked by 10.05.2017 / 20:38
1
answer

Delete or change sql data using php

I'm creating a page where some information will be uploaded, and that information will be transferred to a database and displayed on that same page, as follows: As highlighted in blue, I have created a list with options that the user can c...
asked by 13.05.2017 / 22:08
2
answers

how to use the case with a select coming from html

Good morning, I need to pull data from the database, but wanted the user to choose from which data what value to search. My code html : <head> <title></title> </head> <body> <form method="POST"...
asked by 24.02.2017 / 14:16
2
answers

Laravel Insert data into one table and use the same id to fill in another

I'm starting in Laravel and I'm having a problem with inserting data into two mysql tables ... explaining better would be: I have a table called questionnaires where I have only ID and Description and another table called statements where I have...
asked by 21.02.2017 / 19:14
1
answer

Foreach multiplying results coming from the database (PHP / Wordpress)

How do I stop foreach from multiplying results from the database? I have the following function: $categoriess = (array) get_terms( 'job_category', array('hide_empty'=>false) ); echo '<pre>'; print_r($categoriess); echo '</pre&g...
asked by 21.02.2017 / 18:52
1
answer

Error in JOIN function of MYSQL PHP

My JOIN function is working, however, I do not use the tables, and even then, because the fields are identical, my inputs that have the field of the same name are filled even if they do not have a record of the id of the person in the table. $...
asked by 20.10.2017 / 17:24
1
answer

date field with order by direct in mysql displays a result and in php it comes out different

I'm trying to display a query ordered by the month of a field date , in phpmyadmin the query comes out right and when I display the result of the same query with php the date quit the correct order. query: "select calendario.id_ca...
asked by 08.02.2017 / 03:16
2
answers

Get data using join in two table 1 for many

Good morning, I need to perform a select of two tables that are related 1 to many: Table 1: Products Table 2: Price group I need to get all prices in the price group table, which can be 1 or more. In my case of the select below it ev...
asked by 20.02.2017 / 15:04