phpMyAdmin

DELETE FROM statement not working

血红的双手。 提交于 2020-01-07 07:59:38
问题 I have a table in a database called 'threads' and I want to delete a row where the id is equal to $forumid which is set by the URL. The URL looks something like this: domain.com/viewThread.php?forumid=1 I am getting this using $forumid = $_GET['forumid']; and I am sure that this is working because I use echo $forumid; and it works correctly. But when I go to delete a row using $db->query("DELETE FROM threads WHERE id='$forumid'"); its not working for some reason. Can somebody please help me

Query VERY slow (>30s) in php, but fast when running the query in phpmyadmin

流过昼夜 提交于 2020-01-07 03:44:08
问题 I would consider myself as beginner in mysql/php, dont be to shocked when you see my code :D . I made a php function with mysql queries which take very long (most of the time) when I call the function. They rarely will be executed fast. In PHPmyadmin the single queries in this php function run fast and without errors. Slow Function public function getAllMusicDataNew($playlist_name, $mysqli) { // einzeln alle titel / alle künstler / alle alben auflisten als array $sql1 = "Select distinct

Why am I getting NULL values on Left Join?

女生的网名这么多〃 提交于 2020-01-07 03:44:07
问题 I'm migrating a database a new one to change One-to-Many relationships to Many-to-Many (and to improve the column naming scheme). [Edit: I've created a SQLFiddle for this.] oldDB newDB ========================= ======================================= individuals people - individual_id - id - individual_name_first - first_name - individual_name_last - last_name - individual_name_other - additional_identifier - individual_position - role - individual_group_code - (replaced with people-groups

Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO)

夙愿已清 提交于 2020-01-07 02:26:25
问题 I'm using XAMPP on Windows 7. and when I try to open a login.php of current project I get this error Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in E:\xampplite\htdocs\newfule\mcp\clientlist.php on line 19 Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in E:\xampplite\htdocs\newfule\mcp\clientlist.php on line 19 Warning: mysql_num_rows() expects parameter 1 to be resource, boolean

主机“ xxx.xx.xxx.xxx”不允许连接到该MySQL服务器

匆匆过客 提交于 2020-01-06 22:04:42
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 这本来应该很简单,但是我 无法 让它在我的一生中发挥作用。 我只是想远程连接到我的MySQL服务器。 连接为 mysql -u root -h localhost -p 工作正常,但尝试 mysql -u root -h 'any ip address here' -p 失败并显示错误 ERROR 1130 (00000): Host ''xxx.xx.xxx.xxx'' is not allowed to connect to this MySQL server 在 mysql.user 表中,具有主机“ localhost”的用户“ root”与具有主机“%”的另一个用户的条目完全相同。 我处于机智,不知道如何进行。 任何想法都欢迎。 #1楼 可能是安全预防措施。 您可以尝试添加新的管理员帐户: mysql> CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass'; mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost' -> WITH GRANT OPTION; mysql> CREATE USER 'monty'@'%' IDENTIFIED BY 'some_pass'; mysql

Why I can't log in MYSQL with phpmyadmin?

家住魔仙堡 提交于 2020-01-06 21:29:12
问题 I have a problem. I can log in MYSQL by SHELL or Adminer (root or not-root user, whatever). But I can't with phpmyadmin. 'Cannot log in to the MySQL server'. What can be wrong? P.S. Passwords are valid. 回答1: First Step: check if port 3306 is open. If not then either you can open port 3306 by doing entry in iptables or simply you can stop this service (if not using any other purpose) by below command. $ service iptables stop Second Step: User should have permission to connect from your ip, if

phpmyadmin #2054 cannot log in to the mysql server

牧云@^-^@ 提交于 2020-01-06 19:33:31
问题 I am a newbie in MySQL, Apache, PHP, and phpMyAdmin. The first server I built was on Windows Vista x32bit and it was successful. Then, I try to build the second server on another laptop, it is Windows 7 x64bit and it stucked in error code #2054. I use 'localhost' with a fixed IP address. I installed the server individually from .msi files, NOT a package installer. After I enter my 'root' and my 'password', then I clicked 'Go', it popped up two error messages, one is "#2054 Cannot log in to

如何截断外键约束表?

拜拜、爱过 提交于 2020-01-06 17:03:09
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 为什么 mygroup 上的 TRUNCATE 不起作用? 即使我有 ON DELETE CASCADE SET 我得到: ERROR 1701(42000):无法截断外键约束引用的表( mytest 。 instance ,约束 instance_ibfk_1 外键( GroupID )参考文献 mytest 。 mygroup ( ID )) drop database mytest; create database mytest; use mytest; CREATE TABLE mygroup ( ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY ) ENGINE=InnoDB; CREATE TABLE instance ( ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY, GroupID INT NOT NULL, DateTime DATETIME DEFAULT NULL, FOREIGN KEY (GroupID) REFERENCES mygroup(ID) ON DELETE CASCADE, UNIQUE(GroupID) ) ENGINE=InnoDB; #1楼 根据 mysql文档

error adding a foreign key constraint

安稳与你 提交于 2020-01-06 07:52:48
问题 I have the following query: ALTER TABLE ROUTE ADD FOREIGN KEY (RID) REFERENCES RESERVATION(RID) ON DELETE CASCADE but it generates me an error: #1452 - Cannot add or update a child row: a foreign key constraint fails (`SmarTrek`.`#sql-91e_d09`, CONSTRAINT `FK_RID` FOREIGN KEY (`RID`) REFERENCES `RESERVATION` (`RID`) ON DELETE CASCADE) In designer mode, here's what it looks like: 回答1: That would meant that you already have data in the ROUTE table that does not satisfy the foreign key

Creating a messages list in SQL

自古美人都是妖i 提交于 2020-01-06 06:49:33
问题 I'm trying to create a messages list, like Facebook. Showing only last the message from a users conversation (history) when I send show mine , when I get answer show answered messages (1 row) database data : SQL query SELECT m.message_id, u.username, m.subject, m.message , m.status, UNIX_TIMESTAMP(m.date) as date FROM users u LEFT JOIN messages m ON m.sender_id = u.id WHERE m.message_id in (SELECT max(msg.message_id) FROM messages msg WHERE msg.receiver_id = 3 GROUP BY sender_id) UNION SELECT