mysql

MySQL Search Query - Searching from tags, too :(

So, I've got a webapp that lets users submit code. The submissions are stored in the code table, and a couple of columns of that are Fulltext-Indexed. This is how I have been performing searches up until now. But, users can submit their submissions with as many tags as they like - and I'd like these to be included in the search too (but...

Error with my left joins?

I'm thinking the coffee isn't strong enough today. I need to query the table fb-celebotd to get the photoid that matches the fb-celebotd.celebdate. Most of the other info needed is dependent on the photos table. The following is giving me a mysql error: Select photos.*,photographer.name, events.eventname, events.eventhome, subevents.su...

How many databases can MySQL handle?

My MySql server currently has 235 databases. Should I worry? They all have same structure with MyISAM tables. The hardware is a virtual machine with 2 GB RAM running on a Quad-Core AMD Opteron 2.2GHz. Recently cPanel sent me an email saying that MySql has failed and a restart has been made. New databases are being expected to be creat...

SQL plural/singular searches

How can I make plural/singular words pull all forms? Example: If a person searches for "mens rings" how can I check the data base to see if any of the fields contain mens, men, men's, ring, rings, etc.? ...

best way to search data-base table for user input keywords?

I want to build a product-search engine. I was thinking of using google-site-search but that really searches Google's index of your site. I do not want to search that. I want to search a specific table (all the fields, even ones the user never sees) on my data-base for given keywords. But I want this search to be as robust as possible...

MySQL database back up using Python

I'm trying to write a python script which backs up the database every midnight. The code i am using is below: from subprocess import call call (["mysqldump", "-u", "root", "-p*****", "normalisation", ">", "date_here.sql"]) The first problem i came across is that mysql thinks the ">" is a table when it is not, the query works fine whe...

How to make a "distinct" join with MySQL

I have two MySQL tables (product and price history) that I would like to join: Product Table: Id = int Name = varchar Manufacturer = varchar UPC = varchar Date_added = datetime Price_h table: Id = int Product_id = int Price = int Date = datetime I can perform a simple Left Join: SELECT Product.UPC, Product.Name, Price_h.Price, Price_...

PHP script aborts, causes MySQL transaction to fail, whole app locks for a little while

I'm using transactions in a MySQL database, along with Ajax, and I'm having some troubles with scripts timing out. So, here's a rundown of what happens: Ajax script on page makes request to server. Server receives request; script starts a MySQL transaction. Ajax script is set to timeout after two seconds; times out; tells server to abo...

mysql shortest length match

I dont know how to explain what I want other then to give an example country prefix Argentina-Mobile 549 Argentina-Neuquen 54299 Argentina-Rosario 54341 Argentina-Salta 54387 Argentina-Santa Fe 54342 Argentina-Tucuman ...

Is there a Way to Optimize a MySQL Query that Runs a Function on Every Row?

Hi, I've got a MySQL query that pulls lat longs from a database based on a criterion, tests whether these points are within a polygon, and returns the points that are within the polygon. Everything works fine. The problem is that the query takes approx. 20 seconds to return a result. Is there a way to optimize this query so that query ...

using a database for logging

Is there a reason that most logs seem to be in plain text, as opposed to being put in a MySQL/other sort of database? It seems to me that putting them into a database would make analysis much, much easier…but would that come at the sacrifice of speed or something else? (I'm not that concerned with portability, and obviously you'd have ...

mysql_fetch_array(): supplied argument is not a valid MySQL

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/davzyco1/public_html/notes/functions.php on line 43 is the error I get when I use the below class, even though the class works PERFECTLY with my old webhost. Here's my new hosts php info: http://davzy.com/notes/php.php class mysqlDb { pub...

Best data type for large strings in MySQL

Currently i am setting it as varchar with a max length of 15000 - it is storing forum posts so they can vary in size a lot. Thanks! ...

Prevent repeated row from returning in mysql

I have three tables in restaurant search done in php. The search has option to filter it by multiple type by checkbox state. Some restaurant may come under multiple type and will have multiple entry in type_stack table. Table1 - **restaurant** ------+----------+---------- id + name + place ------+----------+---------- 1 ...

One table, three column MYSQL query question

In reference to my previous question: http://stackoverflow.com/questions/3082817/one-table-two-column-mysql-query-question The command: "SELECT hostname, GROUP_CONCAT(DISTINCT name) as name FROM comments GROUP BY hostname" returns the expected results: 192.168.0.1 user1,user2 192.168.3.5 user3 The same table "comments" also has a "t...

bindings between rails and mysql hosed after restoring to a new iMac

Had to restore from time machine/capsule to a new iMac after my MBP died. Everything but rails (2.3.5) connection to mysql is working. My old socket connection in my database.yml was /opt/local/var/run/mysql5/mysqld.sock To add to the fun, I seem to have multiple installs of mysql. How do I reconnect mysql to rails? How do I locate ...

In Django, how do I objects.get, but return None when nothing is found?

go = Content.objects.get(name="baby") # go should be None, since nothing is in the database. ...

how to make table with jquery?

hai.all..can you tell me how to make table in jquery? i want using this plugin for showing all data which have been input from database.. i use SELECT * FROM inspection_report for showing data table inside process.php file... how to combine with it?? ...

Customer and Business database relationships

I am trying to create a database design and need some help. Diagram is displayed below. The database is for an address book attached to a e commerce site. Its coded in php and uses a mysql database. See my diagram below - I think I have solved my problem but I want to know is this a good way to do it? This is what I would like to do: ...

Doing a URL Re-Write

Hello, When I click on a comment section for a given entry on a site I have, the URL looks like this: http://www...com/.../comments/index.php?submission=Portugal%20Crushes%20North%20Korea&submissionid=62&url=nytimes.com/2010/06/22/sports/soccer/22portugalgame.html?hpw&countcomments=3&submittor=johnjohn12&submissiond...