New answers tagged php
0
There are several disadvantages to using the "month-based row" approach, and I do not see any advantage.
Using a row to represent an instance of attendance for a student makes logical sense. Using a row to represent a month's worth of attendance is arbitrary--why a month instead of a year or a 6-week cycle?
Think about how you'll be querying this data, or ...
0
I would go for the first option, mostly because I believe that less columns are better.
But also:
First of all, the first option would only require an insert when a student is absent, while the second would, first, have an insert for each student at each month, and then for each student that is absent, it would require to update the row each time the ...
0
Looking at the query I am concerned with the number of rows being deleted.
Which is better ?
Deleting the 1,000,000 million rows
Creating a table with 200,000 rows
Look at Deleting the 1,000,000 million rows
It takes a long time
Table remains the same size
You must run OPTIMIZE TABLE to reclaim the space
Look at Creating a table with 200,000 rows
...
2
Another good way to do this is to copy 0.2 mln records to another table and drop the first table with 1.2 mln.
0
If your date_and_time values are always the same, use this query:
select place, food_id, '10:30am' as Time1, '12:30pm' as Time2, '4:30pm' as Time3, DATE_FORMAT(MAX(date_and_time), '%Y-%m-%d') as Date from Activity group by food_id, place;
0
Although it does not seem like a permissions error per se, confirm bullet points 1 and 3 from Carlos's response: port is open on server and accessible, and/or change your connection URL to 127.0.0.1 if MySQL is treating your PHP app's request as TCP/IP from the outside.
Failing that, I would triple check the port and URL in the app's connection setup, if ...
0
sqlbot@dev:~$ /usr/local/mysql/bin/perror 111
OS error code 111: Connection refused
Error code 111 (in parentheses, at the end) means "Connection refused." It is not a permissions error. It does not mean authentication failed. It means you are either trying to connect to the MySQL server using the wrong IP address or port, or the destination MySQL ...
0
It is a permissions error, it means you must check
Your database could be accesed from other hosts than localhost. if your localhost is 5.175.145.251, then use localhost, cause 5.175.145.251 is no localhost, then your database must have permission from 5.175.145.251 access
You database user, has permission from the host that you refer, it means, ...
1
The simplest structure would be a PERMISSIONS table like this:
create table PERMISSIONS
( Site_ID int
, User_ID int
, Role char(1)
, primary key (Site_ID, User_ID, Role) -- scenario 1
-- OR:
, primary key (Site_ID, User_ID) -- scenario 2
)
Use values for Role such as:
A = Administrator
P = Publisher
E = Editor
How many rows you need depends on how ...
0
This is for all intents and purposes, a Cartesian Join.
It is definitely out of the question to join every row and pass through the data a single time since you do not know the running time or the amount of temp table space needed.
Perhaps you could do the following:
If table1 is small and table2 is small
Run SELECT * FROM table1; and load it into an ...
0
Apart from the other tables you should have (like equipments, farmers ...), you can use this approach:
equipment_price
---------------
equipment_id
equipment_name
equipment_default_price
equipment_special_price
-----------------------
equipment_id
special_price_interval_start
special_price_interval_end
equipment_special_price
Now imagine that you have a ...
0
Have a table equipment containing equipID, farmerID, defaultRate, and a table rentRate with equipID, date, specialRate
The equipment table should then have the normal information for the Equipment, and you should write all of the exceptions to the rentRate table.
The actual user interface may allow the user to select a range of dates, and you can INSERT ...
1
I've set GRANT on all the securables.
You want to assign roles to write data for a specific database. When I read this correct you clicked everthing to do this.
Now I think that your user is member of the role db_datawriter and db_denydatawriter. Please remove the role db_denydatawriter and try it again.
0
Total of all columns regardless of duplicates.
SELECT count(d1) + count(d2) + count(d3) + count(d4) FROM Table2;
Total of each column regardless of duplicates.
SELECT count(d1), count(d2), count(d3), count(d4) FROM Table2;
Total of each column without duplicates.
SELECT
count(distinct d1)
, count(distinct d2)
, count(distinct d3)
, ...
Top 50 recent answers are included