mysql

Real time graphing with flot, mysql, php

Hi, I'm trying to draw a real time graph as my mysql table is constantly being inserted with values, like a moving graph referenced from http://kalanir.blogspot.com/2009/11/how-to-plot-moving-graphs-using-flot.html The values actually come from a carbon dioxide sensor which updates the value of the table with co2 values with positions i...

MySQL Correlated Subqueries: Subquery cant find table from outer query?

its been sometime since i used corelated subqueries, i am not sure if i am doing this right. in my subquery 2nd last line, i am trying to get node.id from the outer table. when i try executing the query, i get Error Code: 1054 Unknown column 'node.id' in 'where clause') select node.id, node.title, depthLookup.depth from posts no...

Searching with words one character long (MySQL)

I have a table Books in my MySQL database which has the columns Title (varchar(255)) and Edition (varchar(20)). Example values for these are "Introduction to Microeconomics" and "4". I want to let users search for Books based on Title and Edition. So, for example they could enter "Microeconomics 4" and it would get the proper result. My...

MySqlDataReader stops reading after about 4 minutes and returns

I have a simple query which returns 25,026 rows: MySqlCommand cmd = new MySqlCommand("SELECT ID FROM People", DB); MySqlDataReader reader = cmd.ExecuteReader(); (ID is an int.) If I just do this: int i = 0; while (reader.Read()) i++; i will equal 25026. However, I need to do some processing on each ID in my loop; each iteration e...

how to change default date format when creating table in MYSQL

how to change default date format when creating table in MYSQL ...

Have an issue of extrem slow sp and he dont do his job

i got this sp: DROP TABLE IF EXISTS SplitValuesDump; CREATE TABLE SplitValuesDump ( value VARCHAR(1000) NOT NULL PRIMARY KEY ); DELIMITER $$ DROP PROCEDURE IF EXISTS `ChangeSitesRedirects`$$ CREATE PROCEDURE `ChangeSitesRedirects`( prodimainAddress varchar(255), subdomainMainAddress varchar(255) ) SQ...

Fetch a Web Page and save in Database?

How can i fetch a HTML page and save it to my database in JAVA?is there any easy way to do that? ...

gem install mysql is wrong!

OS:     Fedora 13 Question:     The mysql for rails. I inputed the command "gem install mysql" and the request is error. Error:     Error: Error installing musql:     ERROR: Failed to build gem native extension. /usr/bin/ruby extconf.rb can't find header files for ruby. Gem files will remail installed in /usr/lib/ruby/gems/1.8/gems/m...

VB.NET 2010 and MySql - handling DB NULLs for lazy people

Hi, I want to initialize a class with data coming from a MySql db. Some fields can be null: Dim dr As MySqlDataReader = ... Dim item As New Item(dr.GetInt16(0), dr.GetString(1), dr.GetString(2)) Suppose the last two fields could be NULL In the db, so that calling GetString on that field causes an exception. I could certainly write ...

How to make DB return different rows for subsequent transactions?

I have the below flow in a multi-threaded environment start transaction read n number of top rows (based on a column) from db check some criteria update those set of rows commit/rollback the transaction I am using optimistic locking to handle multi-threaded scenario, but in above situation DB is always returning the same set of rows ...

How to use crystal reports in vs 2008

I'm a beginner at this. I'm using mysql connector .net to connect vb.net with mysql database. But I used ODBC for a crystal report. Is that ok? And I'm also putting a command, will something like the one below work? And how do I designed a crystal report? My first try, I got a lame report with only text on it. Please give links t...

Join performace

My situation is: Table member id firstname lastname company address data ( 5 fields ) contact data ( 2 fields ) etc Table member_profile member_id html ( something like <h2>firstname lastname</h2><h3>Company</h3><span>date_registration</span> ) date_activity chat_status Table news id member_id (fk to member_id in member_profile) title...

SQL LIMIT return 'zero' - 0 - rows(IN PHP)

Hello, I have an error in this query, when the query returns zero rows. Error Number: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-20,20' at line 3 SELECT pl.name,pl.email FROM players pl JOIN players_bonus pl_b on pl.id = pl_b.id_player WH...

How to add only unique records to a database in scalable fashion

I want to add only unique records into a database table. Is there any way to do this without having to do a select to see if the current record already exists, because that will get very time consuming as the table grows. I am open to all types of suggestions (if they exist). Also as a possible alternative, perhaps there are some indexi...

Is the number of concurrent connections particular to a specific data base?

Is the number of concurrent connections particular to a database or to the whole mysql database server? ...

Where to rollback a transaction in PDO ?

my problem is , i have a database design from this link http://stackoverflow.com/questions/3305825/is-my-database-overdesigned edit* ok maybe useing transaction ? but where should i put the rollback if it fails ? $dbConnect->beginTransaction(); $RegisterInsert = $dbConnect->prepare("INSERT INTO companies ( `name`, `address`, `ema...

creating a dynamic menu using php and mysql

this is what I need to genarate <ul id="0"> <li >1</li> <ul id="1"> <li > 11</li> <li > 12</li> </ul> <li > 2</li> <ul id="2"> <li > 21</li> <li > 22</li> </ul> <li > 3</li> <ul> this is my "menu_item" table id int(11) title varchar(75) link varchar(100) parent_id ...

Is it possible to do replication of only one table with different mysql databases in different hosts?

Hi there. I'm trying to do replication of one table in a remote host in my database. Suppose there is a change in the remote database and i want it commited or replicated to my database in order to keep it up to date with the lastest changes without having to run any dumps, cron scripts or something similar. Is there any way to replica...

[MySQL] SELECT query on multiple tables

Hello. I have two tables, foo and bar: +----+-----+ +----+-----+ | id | val | | id | val | +----+-----+ +----+-----+ | 1 | qwe | | 1 | asd | | 2 | rty | | 3 | fgh | +----+-----+ +----+-----+ id is not unique here. Not all IDs in foo have their equivalents in bar and vice versa. I need to count all rows with spec...

how to create a dynamic sql statement w/ python and mysqldb

I have the following code: def sql_exec(self, sql_stmt, args = tuple()): """ Executes an SQL statement and returns a cursor. An SQL exception might be raised on error @return: SQL cursor object """ cursor = self.conn.cursor() if self.__debug_sql: try: ...