mysql

Best way to store and search keywords for a record in PHP and MySQL?

I haven't touched any code in a good 4-5 months so just getting back into it today, usually takes me a week or so to get all the info flowing through my brain again once I take months off like that. So my project I am about to start will be a PHP/MySQL backend bookmarks database. I want to create a nice searchable database with all m...

create and restore a mysql db using a setup project (installer) in VS.Net

What is the best practice for creating an installer for a winform application. The application is supposed to install the following without connecting to internet. .Net Framework 3.5sp1 MySQL Server My SQL Connector Restore Mysql db Update Config file with the MySQL uname/pwd. I have all the msi files for installing the above mentio...

Can MySQL do regular expression substitution in an UPDATE?

I've seen MySQL SELECT examples using the REGEXP operator for matching. Is there a way to do regular expression substitution in an UPDATE? If not, what's the simplest method to run a regex substitution on all values in a column? Feel free to suggest using any programming language or regex implementation. ...

MySql queries: really never use SELECT * ?

I'm a self taught developer and ive always been told not to use SELECT *, but most of my queries require to know all the values of a certain row... what should i use then? should i list ALL of the properties every time? like Select elem1,elem2,elem3,....,elem15 FROM...? thanks ...

Mysql: 1 Table is periodically crashing

Periodically i have one table in my mysql 5.1.41 database that is crashing. After repairing with myisamchk and some server restarts it crashes again. Anybody who has an idea how i can identify what's causing the problem? ...

Perl - If table does not exist

I'm currently using the following which works but throws an error every time the table is created (as it is first trying to insert into a db which does not exist and returning false). $result = $dbh->prepare("INSERT INTO `". $host ."` (URL) VALUES ('$href')"); if( ! $result->execute() ){ $result = $dbh->prepare("CREATE TABLE `" . $h...

MySQL intersection in subquery

I'm trying to create a filter for a list (of apartments), with a many-to-many relationship with apartment features through the apartsments_features table. I would like to include only apartments that have all of some features (marked 'Yes' on a form) excluding all the ones that have any of another set features (marked 'No'). I realized ...

Can you use your own database for Facebook applications?

I am completely new to Facebook application development, but I've got a straight-forward question. I am looking to create an application that would collect a few pieces of information from a user and store it into a database. I wanted to host the database on a MySQL server, but I didn't know how Facebook works with application informat...

Any way of "multiplying" MySql records to test a large db on server?

I have several mysql tables in a database. Currently I am doing finishing test on my website, and one is to test a heavy db to see how much this affects performance (searching). The website is a classifieds website. It would take a very long time for me to insert one classified at a time to reach a significant nr. So I wonder, is ther...

System.Data.SqlClient Namespace for MySQL?

The exception says that there is a network related problem, or that the SQL server does not allow remote access, none of those are true. Can it be that I'm trying to connect a MySQL server, and not MS SQL? Thanks ...

Opening one MySQL connection vs opening and closing a lot of connections?

I have a > x20000 loop in php that checks if an entry exists in a MySQL database, I open & close the connection for every entry in the loop, but a friend told me that's crazy and I should open one connection, run the loop and then close it, but he didn't tell me why. Could someone explain me the benefits of reusing the same connection? i...

cant update mysql table with over 10000 records

Hi, My code is here $query = "SELECT * FROM `table`"; $result = mysql_query($query); $arr = array(); while($info = mysql_fetch_array($result)) { if (!in_array($info['row'], $arr)) { $arr[] = $info['row']; } } foreach ($arr as $v) { $pass = "pass"; $query2 = "UPDATE `table` SET pass = '$pass' WHERE row = '$v'"; $result2 = mysq...

Mysql master log pos changes during a global lock?

Hello, I have to set up a new mysql replication replicating two databases. So I have this script which locks tables, makes a dump and unlocks them. runme.sh mysql -uxxx -pxxx < 1.sql >> logpos.txt mysqldump -uXXX -pXXX db1 > db1.sql mysqldump -uXXX -pXXX db2 > db2.sql mysql -uxxx -pxxx < 2.sql >> logpos.txt first sql file locks tabl...

MySQL percentage (a bit complex?)

There are a few of these around, but I am either slow tonight or I am trying to do something not possible. I have this setup `id` int(11) NOT NULL AUTO_INCREMENT, `score` float NOT NULL, `userId` int(11) NOT NULL `movieId` int(11) NOT NULL Taking that into account, I want to get a percentage of all the experiences from all the users i...

C# Lib to query MySQL DB

Hi Guys, Is there any good nice library to query MySQL DB? I have mysql connector .net installed, and it basically gives me ado.net replaced, like MySQLCommand, MySQLAdapter etc MySqlCommand command = connection.CreateCommand (); command.CommandText = "select * from samples"; but you have to write a lot of code anyway, is there any l...

Connection terminating unexpectedly in mysql

Hi, I have the code to connect to MySql DB using Mysql connection handler, when I try to test the code using break point I see this exception. "Connection unexpectedly terminated." Any idea? Thanks. ...

How can I append a string to an existing field in MySQL?

I want to update the code on all my record to what they currently are plus _standard any ideas? So for example if the codes are apple_1 and apple_2 I need them to be apple_1_standard and apple_2_standard Before: id code ------------ 1 apple_1 1 apple_2 Psuedo Query: update categories set code = code + "_standard" where i...

Android, mysql, and rendering non Latin Characters as well as Latin?

Are these squares a representation of chinese characters being turned into unicode? EDIT:[Here I entered the squares with numbers inside them into the post but they didn't render] I'd like to either turn this back into the original characters when displayed in android (or to enable mysql to just store them as chinese characters not in...

Persistent vs non-Persistent - Which should I use?

My site has always used persistent connections, based on my understanding of them there's no reason not to. Why close the connection when it can be reused? I have a site that in total accesses about 7 databases. It's not a huge traffic site, but it's big enough. What's your take on persistent, should I use them? ...

SQL Query direct or inner join

i want to find a number of clients from certain dates before and after there was a status changes in their credit history. eg: date = 2010/07/25 date2 = 2010/08/30 i want everyone from the table who had a status "pending" before "date" and from the same lists of people, i want to identify lists of clients whose status changed from "p...