mysql

Jquery, drag and drop and save to mysql database?

I have been searching all over the web, i could only found the inettuts-with-cookies, which teach how to use Jquery to perform drag and drop and then save in cookies. Can anyone please show me how to save to database (php and mysql)? I need it badly.. EDIT: First, I am not php beginner, but a AJAX beginner. Those tutorials are only fo...

How can I count the total number of MySQL queries used per page?

Is there a built-in function in PHP or MySQL that will provide the total number of MySQL queries used on a page? I've seen on a lot of sites (mainly forums) they have a message at the bottom saying something like "Page generated in 0.6 seconds with 20 queries". If there's nothing built in then I'll add something to my database class to ...

php connection pooling mysql

Hi, I am planning to use MYSQL. Is there a connection pooling extension available. or what is the normal practice for connection. is this the one used in every where... mysqli_connect("localhost", "xxx", "xxx", "test"); Do people use just normal msql_connect or pconnect..? how better is pconnect and what setting should I do for PConnec...

Implementing Login Velocity Checks

I need to implement login velocity checking for a web service. The service is in ruby and the database is MySql. I can imagine bad ways to do this. For example, have a table that stores every login attempt's time and whether or not it was successful, and every time the user tries to log in, query that table for the last n login attemp...

mysql count child table rows with condition

I have two tables: "user" -> "order" TABLE: user user_id ----------- u1 u2 TABLE: order order_id | user_id | flag ------------------------- o1 | u1 | fA o2 | u2 | fB Y need obtain all users counting how many times have orders with flag 'fA' RESULTS WHAT I NEED: user_id | orders ---------------- ...

Choosing the right database: MySQL vs. Everything else

It would seem these days that everyone just goes with MySQL because that's just what everyone goes with. I'm working on a web application that will be handling a large quantity of incoming data and am wondering if I should "just go with MySQL" or if I should take a look at other open-source databases or even commercial databases? Thanks...

MySQL: How to get results of stored procedure inside a stored function?

Hello, I have a stored procedure that makes very complex joins and returns 1 row of data (LIMIT 1 is used). In my application I then use that data to make some calculations. This way I try to keep business logic out of stored procedures. But now I need to get that data in another stored function to also make some calculations. The reaso...

Question about joining two mysql tables.

I am trying to join two tables; the purpose being able to search and display event information for an artist that is entered by the user. The tables are as follows: artist table: [id],[name] events table: [id],[artist_id],[venue_name],[city],[state],[date],[time] I created a search engine, but what I want to do is when an artist name...

how to query many-to-many ?

Hello, I found following table structures while I was watching ruby on rails tutorial. table actors id int 11 primary key auto_increment name varchar 30 table movies id int 11 primary key auto_increment name varchar 30 table actors_movies actor_id int 11 movie_id int 11 how to I make a query to select movies that an a...

MySQL named pipes on Windows--faster best practice, or bad idea?

Lately I've been favoring using named pipes (option --enable-named-pipes) in MySQL running on windows, and connect via the .NET connector driver. It's often recommended for security purposes, but one thing it allows me to do is connect with "." as the connection string and develop on my PC and deploy to the server without having to chan...

C# MySQL Parameterized Query Problem

I have the following method which is used to populate a DAO from the database. It performs 3 reads - one for the primary object, and 2 for some translations. public bool read(string id, MySqlConnection c) { MySqlCommand m = new MySqlCommand(readCommand); m.Parameters.Add(new MySqlParameter("@param1", id)); m.Connection = c; ...

How to display next row in a set in Rails find

Hello, I want to display "tips" on my page that changes every say 30 seconds. The results from the "find" method in rails is not ordered by ID. It will be ordered by another column. What is the best way fetch "next" value. Is there a way to get number of row in result set and then find by next row id? Thanks, Tam ...

MySQL week calcualtion between two dates

Hi, I've been stuck with this issue for days, which is something like calculating the numbers of weeks that lies between two days, for example: Select @Days = (datediff( week, @pdtFromDate, @pdtToDate) - 1) * 5 This returns the output as 257. I need to convert this script into MySQL. Any suggestions? ...

Storing file structure in PHP

What is the best way to store a file structure, along with files, say from a Zip file? Currently each file is a row in the MySQL database, but obviously no structure can be read from that. I want to avoid storing a binary file. All files should be plain text. Each zip/file structure is private to the user whom submitted it. ...

MySql : Select statement using IN operator

Hi, I have a table with several fields and one field having 3 Comma Separated Values Column 1 Column 2 1 1,2,3 2 2,3,4 3 6,7,8 Now i want to run an SQL query which fetches me the rows which have the value i send as an input. Like in the above example, if i send a value 2 as an input to the function...

Screenshot of current page using PHP

Duplicate: website screenshots using php Is it possible to take a screenshot of the current page using PHP? ...

how to identify the source table of fields from a mysql query

I have two dynamic tables (tabx and taby) which are created and maintained through a php interface where columns can be added, deleted, renamed etc. I want to read all columns simulataneously from the two tables like so;- select * from tabx,taby where ... ; I want to be able to tell from the result of the query whether each column came...

MySQL Sub-select in ON DUPLICATE KEY

Is it possible to do a select in an IF statement in ON DUPLICATE KEY UPDATE? Lets say I want to setup shipping rates by zip code, and in case of duplicate zip code entered, I want to apply the highest rate to apply. My database has a table of shipping rates and a table of zip codes. The zip code table has a foreign key referencing th...

Is using IN (...) the most efficient way to randomly access a MySQL table?

I have a table with 2.4M+ rows, and no indexes. I am 100% sure all the rows have one column (we'll call this id) that is unique, it is of type VARCHAR(255). I now have a file of approximately 10,000 id's and need to pull the entire row for each. Is using IN(...) my best option? Should I add an index? I was thinking for some thinking o...

MySQL query ordering data two ways

Hello, I am tracking page views within modules using the following table: id | page_id | user_id | session_id | created Every page is unique to a certain module; so page 14 only exists in module 2, for instance. I am trying to write a query that tells me when a viewing session began (GROUP BY session_id) for a particular module, but...