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.
Hi! I'm using MySQL with PHP. This is like my table: (I'm using 3 values, but there are more)
id | 1 | 2 | 3
1 | 3 |12 |-29
2 | 5 |8 |8
3 | 99|7 |NULL
I need to get the greatest value in a certain row. If should get: (id - output) (1 - 2), (2-2), (3-1). Is there any queries for this? I've been trying, but I can't get it to work right.
I have a database (mdb file) that I am currently busy with. I would like to know if it is possible to generate MySQL code that would be used to create this database?
Hi folks,
I have a MySQL table that stores (amongst other things) a persons date of birth.
Is there any way to sort the table so the next due birthday is at the top?
I have the date stored in standard yyyy-mm-dd DATE format and seperate year, month and day fields so I can sort it by the first birthday of the year (ORDER BY month, day) but I can't seem to get any further.
Any help would be greatly appreciated.
Zagga
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.
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)
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!!
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.
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!
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]
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
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.
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
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.
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 need to convert a varchar value of 1/9/2011 to a date in mySQL and I want only the month and year. So that I can then use the PERIOD_DIFF function (so I would need the above to be converted to 201101).
I've tried various ways using the STR_TO_DATE function:
SELECT STR_TO_DATE(CYOApp_oilChangedDate, '%m/%Y') FROM CYO_AppInfo
But I get weird results... (for example: 2009-01-00)
What am I doing incorrectly?
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 ?
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,
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.
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?
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?