mysql

What are best database-modeling tools available in general and specifically for MySQL ?

Hi, I have tried searching other SO Questions but not found the answer am looking for and so am posting question here. My question is regarding what are the best database modeling tools available in general and what database modeling tools are available specifically for MySQL Database. Thanks. ...

Plagiarism Analyzer (compared against Web Content)

Hi everyone all over the world, Background I am a final year student of Computer Science. I've proposed my Final Double Module Project which is a Plagiarism Analyzer, using Java and MySQL. The Plagiarism Analyzer will: Scan all the paragraphs of uploaded document. Analyze percentage of each paragraph copied from which website. High...

Parsing rows from MySQL into files using PHP is not working.

I'm trying to parse an entire MySQL table into files named after the rows. However, it seems to miss out a lot of files, and it just isn't working properly, but I don't understand what's wrong. Here's what I'm using: $link = mysql_connect(...); //*Let's assume this is correct* mysql_select_db(*This too*); $query = "SELECT * FROM rules";...

Which MYSQL select method?

Hi, I have 3 tables. 1st -> products 2nd -> labels 3rd -> connectionTable I want to select all products with their labels. I have two methods. I want to ask which one is more efficent. 1st way-> Two queries using while $query = "SELECT * FROM products"; $result = mysql_query($query); while($row = mysql_fetch_array($result, MYSQL_A...

Submit Form problem... Enter key

Hi... I have a form containing several drop lists and a text field, and a button... When I click the button, an ajaxfunction is called... the ajax then calls a php function which gets results from a mysql db... The problem is that I cant do the same thing by just hitting enter in the form, the page just gets refreshed... That explain...

Is there a more efficient way than doing several JOINS (MySQL)?

I have three tables: USER: user_id (pk); username FIELD: field_id (pk); name METADATA: metadata_id (pk); field_id (indx); user_id (indx); value The reasoning for this is that the application allows custom fields to be created for each user. To display all the information for a user I am building a dynamic query (via PHP) which ends u...

MySql: Grouping a grouped statement possible?

Hi, I have a SQL Statement with some joins and grouping applied. I also have a Count() column. This is what the resulting data looks like: +----------------+-----------------+----------------+ | EMPLOYEEID | REQTYPE | SHORT (count) | +----------------+-----------------+----------------+ | 1 | 5 ...

another Form submit question...

Hi again... I have a form that onsubmit calls an ajaxFunction()... The ajaxfunction calls a php function which returns results from a mysql db... Problem is the back button... I want users to be able to search and then search again and then use the back button to get back to the previous search, but this wont work... Remember, the form...

mysql 7columns pk vs. 1 column md5 unique constraint

Hi, i have a very large table which is currently approx 70M rows and growing daily by the thousands , this schema is tipping over every day now so i'm moving to a partitioned table and redesigning the ddl . the table is basicly a collection of NOT NULL INTEGERS(some medium some INT some tiny) which need to have a unique constraint for a...

MySQL full text fails on a particular table

I've been tearing my hair as to why this fails I have the following code $query = " SELECT DISTINCT title, caption, message, url, MATCH(title, caption, message, url) AGAINST ('$searchstring' ) AS score FROM news WHERE (valid = 1) AND MATCH(title, caption, message, url) AGAINST ('$searchstring' ) UNION ALL SELECT DISTINCT title, captio...

How to find number of rows inserted/deleted in MySQL

Is there a way to find out the number of rows inserted/deleted in a table in MySQL? Is this kind of statistics kept somewhere in the database? If not, what would be the best way to implement something to keep track of these statistics? When I say how many, I mean within a certain period (last 24 hours, or since server was up, or last ...

Mysql's LIKE is missbehaving with Hebrew and backslashes, why?

I have the following SQL query which returns the correct results: SELECT * FROM `tags` WHERE tag_name = 'בית\\\"ר-ירושלים' If I change it to SELECT * FROM `tags` WHERE tag_name LIKE 'בית\\\"ר-ירושלים' or to SELECT * FROM `tags` WHERE tag_name LIKE 'בית\\\"ר-ירושלים%' It doesn't work. It will work if I remove all the backslashes ...

How to do Inheritance Modeling in Relational Databases ?

Hi, My question is regarding Inheritance modeling in Relational Database Systems. I have canonical data model and in that I have some fields related to pricing of product inheriting certain attributes from product table and I want to model this inheritance in MySQL relational database and so, "How can we do Inheritance Modeling in Re...

mysql SELECT LIKE must match whole words only to the variable

I have a $string variable, and I use SELECT * FROM db WHERE description LIKE '%$string%' OR headline LIKE '%$string%' As seen, i want to search the two fields "description" and "headline" to see if the string variable matches any of them... Problem is that I want it to match whole words!!! Ex: If description contains "hello", it is...

Cascade a value in a table

Lets say I have two tables, 'a' and 'b'. The relationship of 'a' to 'b' is one to many. Lets both tables have the field status. This field has the values 'active' and 'inactive'. If I set the field status to 'inactive', does MySQL have a way to cascade this down to all tables tied to the row I changed the status value for? Or would ...

Fatal error: Call to undefined method stdClass

I get an error that says Fatal error: Call to undefined method stdClass::mysql_con() in ........../.../includes/script/import.php on line 68. Line 68 corresponds to: if(!$ip2c->mysql_con()) I do have a require_once() statement at the beginning of my script What could be the problem here? Thanks ...

mysql copy catalogue

My server's mysql settings got wiped out. I'd like to move a single catalogue (wordpress install, fyi) to another server where I have mysql running. I did an scp of the catalogue ("cf") under /var/mysql/ over to my new server. Setup a user, granted all privs, everything showed up fine. I can browse the tables and their contents in my...

Library to read a MySQL dump?

I am looking for a library that will allow me to read a mysql dump. I don't want to have to create a MySQL database and import the library and use the MySQL API. I would prefer simply a library that can parse the mysql dump format. I prefer a python library, but other scripting languages are okay. ...

MySQL Order by NULL join

Hi, I'm trying to do an ORDER BY where I want any rows without an entry in the join table to appear at the bottom of the list and then organised by name. Simplified tables are: users (id, name) photos (id, filename, user_id) So far I have: SELECT name FROM users LEFT OUTER JOIN photos ON photos.user_id = users.id ORDER BY *ANSWER HER...

Is MySQL able to return mutiple result set with one query?

I have the following (returning two separate result sets) being successfully executed from a proc but cannot do the same when executing this as a basic query. SELECT * FROM persons; SELECT * FROM addresses; Possible? What's the syntax? EDIT: I am using Ruby's DBI library: dbh.query("SELECT * FROM persons; SELECT * FROM addresses;"...