Tag Info

New answers tagged

0

Weird behaviour. sql Just because the auto increments are "ok" it does not mean the data has not been deleted. According to http://stackoverflow.com/questions/970597/change-auto-increment-starting-number it can be changed via alter table. traffic That there were no traffic by the webpage is weird as users worked with the website. Is it possible that the ...


0

Since you have access to the server root, you should be able to find the config file for Wordpress. It will contain the address, database name, username and password for the MySQL server. Note that you might only be able to connect to it via a localhost, but PHPMyAdmin should help you out with that.


0

Yes, it is possible. However, it's highly discouraged! Unless the site is very simple, and has only one person contributing to it, you will experience issues. You should be looking at file_put_contents() and file_get_contents(), or perhaps file() for the proper functions for handling files. Using file handles directly is the old, and rather cumbersome ...


0

This is not a PHP error, but a MySQL error. Basically, as the error message says you're either not using the correct username, password or the user privileges haven't been flushed since you added the user. That is, I'm assuming that you've removed the username from the error message, and not trying to log in with an empty parameter. You need to check that ...


0

You should check mysql user permission, specially the host field. Mysql documentation


1

I think this could help you. I create this structure: Employee - EmpID (PK) - EmpName - TKID Domain - DomID (PK) - DomName Project - ProjectID (PK) - ProjectName - ProjectStart - ProjectEnd - DomID (Asuming your projects are for Domains) ProjectType - ProTypeID (PK) - ProTypeName RTS - ProjectID (PK) - EmpID (PK) - ProTypeID (PK) - Active (PK) - ...


2

I assume the * is only for demonstration purposes. You can use GROUP_CONCAT to aggregate strings from several rows into one string. In the example below I only include carname, you probably want some more info: SELECT c.carname , GROUP_CONCAT(p.partname) FROM carparts as cp JOIN car as c ON cp.carid = c.id JOIN parts as p ON p.partid = ...


0

What the above answer meant is that you lack privileges connecting to the mysql database from the remote host. Wha you basicly need to do is to grant those privileges with the above statement


0

GRANT ALL PRIVILEGES ON dbname.* TO 'user'@'11.22.33.44' IDENTIFIED BY 'password';


2

you structure looks good . except that you could merge the amount to the part table . as every part is strictly associates with price. also, only reason you will have duplicate rows is if any of your dimensions tables do not follow strict primary constraints. Car - id (pk) - carname - image - category - status Parts - partid (pk) - partname - ...


1

Not knowing what the full relationships are or sample data, try this FK correction first to see if it fixes the problem: SELECT * FROM carparts INNER JOIN car on carparts.carid = car.id INNER JOIN parts on parts.partid = carparts.carpartid INNER JOIN amount on amount.amountid = carparts.amountid WHERE status = 1


1

Aliases can't be used in WHERE. There are couple workarounds. 1. Repeat CASE in WHERE as oNare suggests 2. Put numfield >3 in HAVING instead of WHERE (works for Mysql only) 3. Rewrite query to use inline view syntax : SELECT a.* FROM ( SELECT * , CASE t2.field_max_occupancy_value WHEN 'one' THEN 1 WHEN 'two' THEN 2 WHEN 'three' THEN 3 WHEN ...


0

You can only use column aliases in GROUP BY, ORDER BY, or HAVING clauses. Standard SQL doesn't allow you to refer to a column alias in a WHERE clause. This restriction is imposed because when the WHERE code is executed, the column value may not yet be determined. Try running: SELECT * , CASE t2.field_max_occupancy_value WHEN 'one' THEN 1 ...


1

You can issue your query and retrieve any column from the table. If the result set is empty, the key is not there. SELECT whatever FROM table WHERE [key] = 'blah'


0

this is a solution working on sql 2005 so it should work on recent version also: declare @field as varchar(50); -- put appropriate datatype here select @field = null; -- i prefer to be sure of the initial value SELECT @field = field FROM TABLE WHERE [key] = 'blah'; if @field is null print 'key is not there'; else print @field; if you ...


1

You are getting this error because the root account on your local machine doesn't have a password. That's why you can login locally with using password: NO Probably your server on godaddy has a password set, or the root account disabled. You need to fix the credentials in your application (and probably use a login other than root)


0

sorry for that late answer and my bad english :) currently i am working on a session-hybrid with ZebraSession and my own ClientCookie-Session Class. I nerver heard about GET_LOCK so i started to search for its usage. Now i am stumbled into your post. Maybe your (or all ZebraSession Users) Problem a) depends on the MySql Version you are running. b) You ...


-2

you should use IN() instead of OR. Because if 1 condition satisfy in OR it will give true flag. That is why it gives only one record.


0

There are multiple resolutions however in most cases you will not be able to do them unless you have access and the ability to: Downgrade PHP Upgrade the MYSQL Libraries to match the version of MYSQL on the server. Change the my.cnf file Comment out OLD_PASSWORDS = 1 restart mysql Create or modify a user with the password desired Uncomment out ...


0

You don't need any looping in PHP Just use a single aggregation query SELECT COUNT(B.type) "how much",A.type FROM (SELECT 'a' type UNION SELECT 'b' UNION SELECT 'c') A LEFT JOIN (SELECT type FROM table WHERE `blocked`='0' AND `location`='y') B USING (type) GROUP BY A.type ORDER BY A.type; Subquery A is essentially an array of types I would also index ...


0

The way I'm understanding your question is that since the arrays for a and b don't have a value for 'in location y', the loop 'skips over' it and displays the value 1 for d in the first open row. You could try pulling out locations for all the arrays (even the non-y values), and then using an if statement to display either 0 or the result you want. You can ...


0

Sitename is a string, but you're not enclosing it in apostrophes, so SQL is interpreting it as a column. Please try adjusting like so: "option_name='" . $value . "'"


0

This will display the rank you requested SET @prev = 0; SET @rank = 0; SELECT name,tu_total total,rnk rank FROM (SELECT *,(@rank:=@rank+IF(@prev=tu_total,0,1)) rnk,(@prev:=tu_total) prev FROM (SELECT name,tu_total FROM TOPUSER ORDER BY tu_total DESC) AA) AA; If TOPUSER has an id field, here is the update of the rank SET @prev = 0; SET @rank = 0; UPDATE ...


0

Perhaps you may want to experiment with setting those limits on the user account itself You can allow 250 simultaneous connections for a specific user account GRANT USAGE ON *.* TO myuser@myhost MAX_USER_CONNECTIONS 250; You can throttle connection attempts by the hour as well GRANT USAGE ON *.* TO myuser@myhost MAX_CONNECTIONS_PER_HOUR 250; Those ...


0

I think you have misdiagnosed the problem. Do you really need that? Do you have 251 terminals trying to connect as your userid? Have you set the MaxClients (or whatever) so high that the web server is trying to connect that much, and failing to disconnect? Consider lowering that instead.



Top 50 recent answers are included