Hi,
I have 2 tables in my db: students and absences. In students: id_student, s_name; and in absences: id_student, date, day(the day of the week as number-it's not so important);
I would like to get the students that were absent for more than 2 days consecutive and the dates.
At the moment I have the next query:
/*To control when the days are…
I have a table defined like this:
create table users (
id int(10),
age int(3),
name varchar (50)
)
I want to use a query to update just age, which is an integer, that comes from an html form.
When it arrives to the method that updates it, it comes as a string, so I change it to integer with PHP and try to update the table, but it…
Problem is as follows. I have a product that can be in one of three categories (defined by category_id). Each category table has category_id field related to category_id in product table. So I have 3 cases. I'm checking If my product.category_id is in table one. If yes, I take some values. If not I check in tables that are left. What can I…
I have a query that is looking at a 'page_views' table. And I so far have the ability to get the total views by day. However, I am having an issue with getting unique views by day.
The column I am testing against is user_id... Here's the query I have for total views.
SELECT
site_id,
CONCAT(month(created_at) , '-', …
Hello everyone,
first of all I want to apologize for my bad english.
So I have two tables.
diseases
-----------------------------
| ID | NAME |
-----------------------------
| 1 | Disease 1 |
| 2 | Disease 2 |
| 3 | Disease 3 |
diseases_symptoms
…
I'm a new Rails Developer, and I'm working on a legacy Rails app. Whenever I run the rake db:create command, I get an error that the database couldn't be created. I have found many StackOverflow questions related to this, but in troubleshooting nearly all permutations of solutions, I couldn't resolve…
I've been looking into JOIN, subqueries and other ways of doing this, but I can't work out the best way to do this is...
I have a table (ps_category_product):
id_product, id_category
I want to perform a query on it like:
SELECT id_product FROM ps_category_product WHERE id_category='$this_cat'
BUT, I…
I have a simple join in a query however I need to have a condition on both of the tables "confirmed='yes'" but if one of the tables doesn't have any that match the query returns with no rows.
Database:
.----------parties----------.
| id - party_id - confirmed |
|---------------------------|
| 1 …
would like to be able to sync a subset of tables between two mysql databases that are running on the same server. One of the databases acts as the master where inserts, updates and deletes can be made. The second database uses those same tables for read-only operations. I do not want to use federated…
Hi
I have the following tables
CREATE TABLE `files` (
`fileid` int(11) NOT NULL AUTO_INCREMENT,
`filename` varchar(255) NOT NULL,
`filesize` int(11) NOT NULL,
`folder` int(11) NOT NULL,
PRIMARY KEY (`fileid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `folders` (
`directoryid`…
I am attempting to narrow results of an existing complex query based on conditional matches on multiple columns within the returned data set. I'll attempt to simplify the data as much as possible here.
Assume that the following table structure represents the data that my existing complex query has…
I currently have a table which stores a load of statistics such as views, downloads, purchases etc. for a multiple number of items. To get a single operation count on each item I can use the following query:
SELECT , COUNT()
FROM stats
WHERE operation = 'view'
GROUP BY item_id
This gives me all…
I have a simple join in a query however I need to have a condition on both of the tables "confirmed='yes'" but if one of the tables doesn't have any that match the query returns with no rows.
Database:
.----------parties----------.
| id - party_id - confirmed |
|---------------------------|
| 1…
Not quite sure how to ask or define this, but can't figure it out.
I have three tables like this:
persons person_id, first_name, last_name
hobbies hobby_id, name
persons_hobbies person_id, hobby_id
I need to make two lists. Persons that have both hobby A and B, and…
Hello,
I have a database full of rows like
id,action,date
2,2,2010-03-01
3,2,2010-03-01
4,3,2010-03-01
5,3,2010-03-01
6,4,2010-02-01
7,4,2010-02-01
And I want to select all the count all the 2's and all the 3's and all the 4's. But I don't want to have to do 3 different SELECT COUNT()…
Well, I know there is a funciton mysql_fetch_array() and we can use it like this:
while ($row = mysql_fetch_array($result)) {
echo $row['name'] . "<br />";
}
But is there any other way? For example, if there is only one element that can be returned, and not an array.
Thanks)
Hi,
I am trying to create a view for a UNION of 2 select statements that I have created.
The UNION is working fine when executed individually
But the problem is only the 1st part of the UNION is getting executed when I am executing it as a view.
The query I am using is as below
…
This posts highlights some great scripting language sessions coming
up at the Oracle OpenWorld and MySQL Connect conferences. These
events are happening in San Francisco from the end of September. You
can search for other interesting conference sessions in the Content Catalog. Also…
Can anyone suggest a good online free MySQL database. I've tried four till now:
db4free FreeMySQL onPhP 000webhost
Either of them gave me an timeout error on my connect file or actively restricted connection to it, meaning the host won't allow a remote connection to the database.
…
I have used adodb using odbc database connectivity for connecting vb.net to mysql. I have fetched table values into recordset. I want to fetch only one column values (for example, table name-login, column name-password and values in password column are "manage","sales","general"). I…
This is nilesh , i am newcomer in this field , i need the script for when i click the upload button then uploaded images it should preview and store into db like wise i want to upload 10 images at same page using php mysql .
#div
{
border:3px dashed #CCC;
…
Could you recommend based on your experience a PHP/MySQL-based admin interface for managing your website ads? In order to be really useful, such application should have:
-basic CRM functionality to track who is providing the ads
-multilingual multi country support: have the…
I have a Web server running on RHEL that is running Apache and MySQL. It has a Quad core 3.2Ghz Xeon CPU and 8 Gigs of RAM Most of the time, we don't have any issues at all.
Our web application is very database intensive. When our usage gets pretty heavy MySQL will peg out at…
I've been a designer for several year now. I'm now very interested in learning PHP, MySQL. I've read through W3Schools already and it helped me become familiar.
I now want to know where I could go to start building some simple database and php applications so I could be come…