I am trying to insert data into a contacts table using foreign keys in mysql, the structure of tables are as follows CONTACTS TABLE id contactname phone_number fk_id USERS TABLE pers_id …
Tag: sql
query don´t show one result
i have this query: i can show my result, but always don´t show all, i want to say that if my result it´s 3 my query show 2 when all my result have the same result. all data have state=”pendiente” table user table asistencia table actuacion table contratan i attached my migration for you can show mi ralation Answer I
How can I use an SQL query’s result for the WHERE clause of another query?
Okay, basically I have a table that contains statements like: I would like to use the contents from this table to generate other tables that fulfill the conditions expressed in this one. So I would need to make it something like But the last part of the where has to come from the first table. Right now what I’m trying
Unable to update a field in phpMyadmin using PHP
I have been trying to update a field in database using php, everytime I run the script there is no effect on the table. Here’s how my code looks : where $link is the connection variable which is working fine with other queries. Here’s the table structure. The $result variable is returning true. I am unable to understand where the
php echo each unique sql order by
From a db table I query all the results and order those by place. I echo this query into checkboxes. So every place has its own checkbox. Above all the checkboxes there is a title like select one or multiple places but now I would also like to add a title to each set of places. I have the following
What is the right approach to insert multiple id’s of petitions to single user?
I am very open to edits of the title Basically I am making a site about petitions. I want a user to be able to sign more than one petitions and be able to see list of petitions he signed. I am wondering what is the right approach to do it. Approach 1 that I thought of: Every petition has
Search function on multiple rows in the same table
I’m wondering how do I add more row’s on my search script to be searched. Here’s my php script: As you can see this: I want to it to search on region and rank rows. I tried: …. it’s showing 0 results. Thank you in advance. Answer Is this what you want? This searches for the parameter in both columns
Mysql: Query which orders by default and rank (pin/hold up entries?)
I have a products table which contains all my products. Those products table gets filled permanently with new products. However, I want to have the possibility to “hold up”/”pin” certain products to a place in the returned query collection. Means, I want to set something like rank_index which contains the number the product should have in the returned query collection.
Add a reference back to original column?
I have a Categories -> Products -> and Review Table. My question is whether it’d be optimal to create a reference from the Review Table and the Category it belongs to, or should I just use the …
Generate a last 7 days weekly report in Mysql
I want to get a report of my eco_orders table that how much order i get in a day for last 7days. I got the result with below sql and it’s absolutely fine. but the problem is I want to include the non order day count with zero Answer You can try this option –