mysql

MySQL query using an array

Hi, I'm trying to query a MySQL database using an array but I'm having trouble! I have a table called clients, I want to be able to select 'name' from all rows whose 'sector' column is equal to $sectorlink. I then want to put all the names into an array so I can perform my next query: select all rows from another table whose 'client...

php beginner question. if statements

check it, i have this table tablename: reports id (AI) content (varchar), contentID (int), checked (tinyint) if (isset($_GET['reportPost'])){ $query = mysql_query("select * from reports where contentID = $_GET[reportPost]"); $report = mysql_fetch_assoc($query); if (!mysql_num_rows($query) && $report['checked'] == 0) { echo 'T...

How can I connect to MySQL from windows forms?

How can I connect to mysql data base from windows forms? ...

School Database Design Required.

I am planning to build a database for a school application. I have designed a database to hold time tables for all the classes. It should also relate to the teachers taking the subject for the class. Also should be able to handle a public holidays mentioned. Also the attendance of all the students and teachers. Please guide me with the...

MySQL DELIMITER syntax errors

This MySQL script installs multiple triggers. It works on one machine running MySQL 5.0.51b-community. On another machine running MySQL 14.12 Distrib 5.0.45, for redhat-linux-gnu (i386) it fails, with this error message, which seems to be related to the DELIMITER // ... // DELIMITER; syntax : ERROR 1064 (42000) at line 272: You ha...

How do I add a reference to the MySQL connector for .NET?

what dows this mean: Next add reference to: MySql.Data actually i have downloaded mysql connector/net. by following these instructions: First, you need to install the mysql connector/net, it is located at: http://dev.mysql.com/downloads/connector/net/1.0.html Next create a new project Next add reference to: MySql.Data Next add "us...

How to optimize mysql indexes so that INSERT operations happen quickly on a large table with frequent writes and reads?

I have a table watchlist containing today almost 3Mil records. mysql> select count(*) from watchlist; +----------+ | count(*) | +----------+ | 2957994 | +----------+ It is used as a log to record product-page-views on a large e-commerce site (50,000+ products). It records the productID of the viewed product, the IP address and USER_...

mysql stored proc

hi all how can i execute a stored proc in mysql db? i have to pass parameters and to catch the result out off stored proc. ...

jquery dynamic pagination for comments

I would like to create a pagination system for comments in my website.So far, I have been able to create pagination using php/mysql and html but the page has to refresh every time we click on the next button(for the next set of comments) or previous or a particular page.... As far as my knowledge of jquery is concerned I am thinking th...

What's the best way to create a single field in the table is designed to keep the computation of a different table fields

i want to save a balance of user, in the user table . the balance calculate from other table rows, is trigger on the other table is the best way ? or do it in script languages like php ? It is important that to be accurate, and performance. thanks ...

MySQL - how can I avoid high load when I switch schemas (databases)?

I have approx 10M rows of data across 20 tables, which I process once a month. I do this by copying those tables into a new schema (database) then making the changes, so the updates are not running against tables that are being queried. To make the new data live, I have tried: changing the database name that's coded into the applicat...

Why I can't insert new row into partially locked table in MySQL 5 InnoDB?

In manual it said that InnoDB has row-level locking, so why if I select some of the rows with FOR UPDATE statement it won't let me insert new row into that table? New row shouldn't be locked after all, it wasn't selected. ...

Want to find out total number of results returning from mysql.

I want to know how many results have been fetched from mysql through my query... ...

Best way to link a table to 2 different keys ?

Hi, I'm designing a mySQL DB and I'm having the following issue: Say I have a wall_posts table. Walls can belong to either an event or a user. Hence the wall_posts table must references either event_id or user_id (foreign key constraint). What is the best way to build such a relationship, considering I must always be able to know who ...

how to implement this in GQL(Google Query Language)

In MySQL it's like: select * from table1 where column1 in ('a','b','c'); how to do that in GQL? ...

What's wrong with this mysql query?

SELECT app_contracts.*, app_customers.id as customer, app_boards.id as board WHERE app_customers.id=app_contracts.customer_id AND app_boards.id=app_contracts.board_id ORDER BY app_contracts.id DESC Error: Error Number: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server ve...

Anyone care to help optimize a MySQL query?

Here's the query: SELECT COUNT(*) AS c, MAX(`followers_count`) AS max_fc, MIN(`followers_count`) AS min_fc, MAX(`following_count`) AS max_fgc, MIN(`following_count`) AS min_fgc, SUM(`followers_count`) AS fc, SUM(`following_count`) AS fgc, MAX(`updates_count`) AS max_uc, MIN(`updates_count`) AS min_uc, SUM(`u...

Unable to install MySQL manuals to Mac

This question is based on the thread. I downloaded the manuals as the file "v5.1 (Maria) TGZ". I moved the file to /usr/share/man/. I could not access the manuals by man mysqlbug The .tar.gz -file has these files which do not include README comp_err.1 innochecksum.1 make_win_bin_dist.1 msql2mysql.1 my_print_defaults.1 myisam_ftdump....

Should you accurately specify column types in MySQL?

When I define columns in MySQL I generally use int, varchar(255), text and the occasional enum for boolean. What are the benifits of accurately specifying column types rather than just leaving them at maximum? For example a password field encoded as MD5 will never exceed 32 characters so is there a tangible performance gain from using ...

Large MySQL tmp files using Joomla/VirtueMart

I am using Joomla 1.5 and VirtueMart 1.1.3. There is an issue where tmp files that are 1.6 GB are created every time a certain query is executed. is this normal? I think virtuemart is using a huge join statement to pull the whole products table and several other tables. I found the file that builds the query but i don't know where to be...