Maybe i have the wrong context but...
Is there a corelib site for mysql like http://corelib.rubyonrails.org/ for ruby on rails RoR?
Would be nice to have 1 stop shop. thx.
hello
I'm try to store String (that contain html ) to mysql database by using Longtext data type.
but its always says "You have an error in your SQL syntax".
(note : i tried to store normal text , and its work)
I have a mysql table of 3 integer fields. None of the fields have a unique value - but the three of them combined are unique.
When I query this table, I only search by the first field.
Which approach is recommended for indexing such table?
Having a multiple-field primary key on the 3 fields, or setting an index on the first field, which is not unique?
Thanks,
Doori Bar
I want to find top rated item using AVG function in mysql, right now my query looks like this:
SELECT a.title, AVG(d.rating) as rating FROM in8ku_content a
JOIN in8ku_content_ratings d ON a.id = d.article_id
ORDER BY rating DESC
Problem is that it takes AVG of all items and the result is not accurate, what should be changed here to get correct result ?
Tables:
in8ku_content [id, title] in8ku_content_ratings [id, article_id, rating]
Below is my current structure for MySQL database
id | item_name | item_files
------------------------------------------
1 | Item A | file1.zip,file2.zip,file3.zip
2 | Item B | file3.zip
Example I create simple form to fill up Item Name and Multiple upload files then store it to db.
Question :-
How to design the db structure for accept the multiple files?
There have a way which I don't want to use explode, implode to get the file1.zip file2.zip file3.zip
A site has blocked with google.
There is a site for this issue:
http://25yearsofprogramming.com/blog/20070705.htm
How can we detect mysql injection?
Thanks in advance.
Hello all
I have a table in a MySQL database. I am given a value that occurs as a cell value in that table but I do not know which cell is it i.e. the row and column of that cell. What is the most efficient way to find the column to which that value belongs? Thanks in advance.
I'm trying to make a stored procedure but it doesn't seem to be recognizing the parameters I've given it.
Procedure
create procedure test_pro(IN searchTable VARCHAR(55))
begin
select * from searchTable limit 10;
end //
Trying to execute
mysql> call test_pro('exampleTable');
ERROR 1146 (42S02): Table 'db.searchTable' doesn't exist
It isn't replacing the searchTable with the parameter that is passed in.
Hi,
Is there any application that will read a MySQL database table and generate a SQL script of INSERT statements (so that I can copy tables from one db to another db)? OR how can I transfer content from db1.table1 to db2.table2 where table1 and table2 is same.
Thank you.
Hi,
I need some advice from experts :)
I will develop a website using PHP and I will use also MySQL. I bought some server space from a Virtual private server including all the service needed.
How should I develop the site? Shall I develop it on my machine at home (using for example Wamp), and when ready transfer all the files to the server? If so what is the best method to transfer also the database?
Thanks in advance!!
Hi, I'm wondering how I can sort mysql data based on the number of entries.
I'm doing this so I can have a page of the top purchases, so it would have to retrieve all the product_id's from a table, and then sort them by the most times one shows up, limiting it to 10 or something.
Thanks!
You may notice from my last question that a problem caused some more problems here.
My database is now unusable partly due to my interest to break things and my inability to look at error messages. I know that I should not reuse primary keys, but I would like to use them again after the removal of the database that I deteriorated. So
How can you correctly remove MySQL database?
I got this odd error and I can't figure out where it came from:
Warning: mysql_query(): 3 is not a valid MySQL-Link resource in (...)
What's up with the 3? I don't get it. Has anyone experienced this error themselves?
Hi,
Say If I get a resultset in mysql as :
ID count(posts)
101 2344
102 3245
103 232
104 23
Is there any way to get the tota count of count(posts) in the query itself,
like this?
ID count(posts)
101 2344
102 3245
103 232
104 23
------
5844
I have two table in mysql named rootpath with only one field 'root' and savecatogory with fields brandid,categoryid,name.There is no relation between these two tables.Now how can retrieve root,brandid,categoryid using single query.Please help me.
How can I correct the problem I keep getting from the code below which states 'user_id' in where clause is ambiguous. Thanks for the help in advance.
Here is the mysql table.
SELECT user.*, user_info.*
FROM user
INNER JOIN user_info ON user.user_id = user_info.user_id
WHERE user_id='$user_id'
Hi Guys,
I'm building a part of a system where the user can define "views" from a mysql database.
I want some way of generating simple HTML tables/reports from the data, but not just plain output of sql queries- simple joins probably isn't enough.
Any ideas?
How would i monitor a MySQL to detect SELECTs which are running slowly? Having identified a poorly performing SELECT, how would i analyse it with a view to improving it?
hi,
currently i have 2 table in mysql
structure:
messages
id | content | user_id | time
submessages
id | subcontent | msg_id | user_id | time
submessages msg_id is FK for messages id.
Now i need to query from php
$cur_user = $user->current; // current user id.
SELECT * FROM messages WHERE id > '{$_GET['id']}' // problem here
how do i query submessages that posted by others not include current user?
thank you.
I want to group my data by Age and by gender: like this sample data:
Age: 1
Male: 2
Female: 3
Age 1 Total: 5
Age: 2
Male: 6
Female: 3
Age 2 Total: 9
How can I group the data according to age and count all the male and females in that age from mysql database?
hey everybody
i'm trying to do somthing simple like this
SET i = 0;
WHILE (i <= 2230686) DO
INSERT INTO customers(check) VALUE(0);
SET i=i+1;
END WHILE;
in the phpmyadmin SQL query box
and it doesntwork and the mysql doesnt throw an understandable reason
any clues ?