mysql

SQL Select only players that have played x amount of games in recent y days?

Q: How do I make MySQL only SELECT all users that have played => x amount of games within the y most recent days? This is all used for a gaming ladder. I use two tables: weblPlayers has only the user info (username, email, password etc), and weblGames has the result of every reported game along with the date and time, properly formatted...

Analyzing Phone Call Records in MySQL DB

Hello everyone, Last time I asked a question here, I got tons of great ideas on how to solve a particular problem. Like I explained last time, programming is just something I love to do, but it's not something I studied in school, so I have no proper methods of doing things. I'm an Electrical Engineer struggling through a recession doi...

PHP/MySQL Activity (ala facebook)

This may be a hairy question but. Say I have Followers: -user_id -follower_id Activities: -id -user_id -activity_type -node_id Pulling a users activity is fairly easy. But what is the best way to get a followers activity? A subselect? It seems like it is incredibly slow as users get more and more followers. Any ideas to speed this...

Dynamically changing the value in a column when it equals a certan value

I have a column of values that print out N/A. Instead of N/A, I'd like to print three dashes. One thing to note is that some of the values in the column are not N/A so I need to print those. Basically I want to substitute the N/A for "---". Can someone please tell me how I can do this? Thanks ...

Supplied argument is not a valid MySQL result resource???

I get this error when I use this code for people to input data. The submit form won't be listed cause it's not useful in this circumstance: function some_more_custom_content() { $output="<BR>"; ob_start(); if ($_REQUEST['code'] != "") { $code = $_REQUEST['code']; $query="INSERT INTO `fc` (`code`,`datetime`) values ('" . mysq...

mySQL to retrieve records that repeat a value in order

Hello, I have a big table with 300,000 records. This table has a integer value called "velocity" and it`s value is from 0 to 100. In the firsts records, the value is 0 and I want to remove. I want to remove from the query, the records where the velocity field repeats more than 10 times. For example: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 5...

How Do I Correct mysql.rb Drivers?

For the last several days, I've been struggling to get ruby on rails to work on my mac. The main culprit is MySQL. Every time I fix one thing, another error shows up. I upgraded/downgraded MySQL to play nice with ruby, rail and gems, but nothing. My latest error is: !!! The bundled mysql.rb driver has been removed from Rails 2.2. Please...

Help with MySQL LOAD DATA INFILE

I want to load a CSV file that looks like this: Acct. No.,1-15 Days,16-30 Days,31-60 Days,61-90 Days,91-120 Days,Beyond 120 Days 2314134101,898.89,8372.16,5584.23,7744.41,9846.54,2896.25 2414134128,5457.61,7488.26,9594.02,6234.78,273.7,2356.13 2513918869,2059.59,7578.59,9395.51,7159.15,5827.48,3041.62 1687950783,4846.85,8364.22,9892.55,...

Split MYSQL results into 4 arrays..

Hi all, I have a mysql query which spits out the following: Array ( [0] => stdClass Object ( [bid] => 18 [name] => Cafe Domingo [imageurl] => sp_domingo.gif [clickurl] => # ) [1] => stdClass Object ( [bid] => 19 [name] => Industrial ...

Getting news from mysql, use of alternative function

Hey! Is there any way to use other functions as mysql_fetch_xxx for getting news from mysql db? I have used echo mysql_result(mysql_query("SELECT title FROM news WHERE id = $_GET['id']")); but function doesn't work at all. Any alternatives? ...

Massive MySQL Query

If we have table such as this message: Id (INT) | message(TEXT) | date(TIMSTAMP) And lets imagine that there is constantly data comming into this table. For example 1, 'Hello World', 12345678; 2, 'Yoooo Whats Up', 12345679; 3, 'My name is Hal!', 12345680; Now this table is huge and is never deleted SELECT * FROM ar...

How to add relation between two tables in Mysql using Mysql control center

I want to create two tables with one to many relations. I use MySql Control center,but I did not find to add foreign key.I do not want to use console commands,How can I do? I also want to use transation so I use InnoDB table type, How can I add relation between two tables in Control Center.Is there another GUI software to handle Mysql?Pl...

Mysql repeating incremental numbers?

How can I get Mysql to incrementally generate a number between 0 to 99999 and add it to the record? Also once 99999 is reached its starts back at 0. ...

PHP: Show yes/no confirmation dialog

My php page has a link to delete one mysql table data.i want it to be in such a way that when i click the 'delete' link a confirm box should appear and it shoul ask for "are you sure, you want to delete?" with two buttons 'yes' & 'no'.when i click yes ,i want to delete the mysql table's data,and when i click no,nothing should happen. ple...

Question about Visual Studio and MySQL connectivity

Possible Duplicates: Where to begin with Card Reader application in C# How can I connect to MySQL from windows forms? I have installed XAMPP, which includes MySQL version 5. I need to connect to this database from C#, but when I try to add a data source in Visual Studio it doesn't have a provider for MySQL version 5. What do...

Whare are the differences using xml and mysql database? Which should I use?

Well, I know its a bit stupid. If I want to store a large amount of data. Should I use xml or database(mysql)? Why do you choose (that) one? What are the pros and cons using xml? What are the pros and cons using mysql? Clubpenguin, habbo hotel, those virtual worlds are using xml or mysql?? ...

[PHP] Inserting an array of lines into an SQL table

Hello everyone, I would really appreciate if you would take a look at this piece of code: <?php if(isset($_POST['add'])) { $self = $_SERVER['PHP_SELF']; //the $self variable equals this file $ipaddress = ("$_SERVER[REMOTE_ADDR]"); //the $ipaddress var equals users IP //connect $connect = mysql_connect($host,$username,$password) or di...

Make MySQL show every users rating and then sort the results using ratings?

Q: How do I make MySQL also show every users rating and then sort the results using ratings, desc? This is all used for a gaming ladder. weblGames has the result of every reported game and has info about who won/lost, and what the winner/losers rating became (winner_elo & loser_elo). Here is a partial screenshot of the table: http://w...

What is the standard of coding in PHP in the sense seperating css, phpfles and database

Give me the best standard way of coding in PHP. where to store my css, php, images etc. How to seperate my folders, How many folders and whats the name of that folder? ...

DB function reports no errors when adding new article in Joomla!

Possible Duplicate: 500 - An error has occurred! DB function reports no errors when adding new article in Joomla! I have an article that I want to publish on my Joomla! site. Every time I click apply or save. I get error 500 - An error has occurred! DB function reports no errors. I have no idea why this error comes up, al I can ...