mysql

a table of forms that updates MySql database, PHP framework

I am on the lookout for a good PHP framework and/or ORM. I'm thinking that I'll go with the one in which the following is easy/clean to implement: A table of forms filled out with DB values. If you change a value or add a new row, pressing "save" will update or insert DB rows and redraw the table. The data comes from a few different t...

how can I encrypt an entire column

Hello All, I'm setting up a mail server and I'm mysql for the passwords table. Currently it's secured using the ENCRYPT() function however I have a large CSV I'd like to import where the passwords are all plain text. Is there any way I could import these as plain text and then run a query to run ENCRYPT() on the whole column and update ...

How do I look at the schema of a MySQL database on cPanel?

My question isn't so much programming specific, I guess, but more interface-specific. My problem is that I need to look at the schema of some MySQL databases which are stored on a server that uses cPanel. How do I just simply look at their table and column names remotely? ...

Have a mysqldump with Indexes. How do I import it by disabling them?

I am trying to import a large database but because there's an index, it is taking forever to import the database. I tried copying the raw files to a different machine but for some reason, the largest table is not being read giving me an error: can't read file: 'tablename.MYD. So I mysqldumped my old database but it did so with an index. ...

mysql left join query takes much time to execute

This is my query can anyone tell me why this query taking much time excute... select gf_film.film_id, film_name, DATE_FORMAT(film_release_date,'%d') as date, DATE_FORMAT(film_release_date,'%m') as month_ori, DATE_FORMAT(film_release_date,'%M') as month, DATE_FORMAT(film_release_date,'...

Fast way to execute MySQL stored procedures in Java within multiple threads?

What is the fastest option to issue stored procedures in a threaded environment in Java? According to http://dev.mysql.com/doc/refman/5.1/en/connector-j-usagenotes-basic.html#connector-j-examples-preparecall Connection.prepareCall() is an expensive method. So what's the alternative to calling it in every thread, when synchronized access ...

Want to replace fulltext, and %foo% search with something better (and faster).

I have a site (built in php) where I have roughly a million records in a mysql table. There is a very complex "advanced" search which allows the data to be searched, sorted, and ordered in hundreds if not thousands of various ways. Unfortunately, mysql search isn't that good, and is extremely slow. Average search takes 5 seconds curren...

ColdFusion Databse settings

I have recently agreed to do some minimal editing to a ColdFusion site and was hoping to get some help on here as to where a place to look for db settings may be. I have not been able to locate the database config file or something similar. A point in the right direction as to best practice for ColdFusion would be really helpful or an ...

I need advice on how to simplify/improve an ordering model in mysql

I would like to know if it is possible to simplify the following process: I want to mark a game for shipping to a customer based on the following criteria: (If you are familiar with Netflix, it's the equivalent of their movie queue.) How many games they have at home. How many games have they received in total for their billing month. ...

Where can I find a good open source user account management class/library in PHP?

I am looking for a good framework for user and user group management in PHP. I want a to be able to add/edit/delete profile, save in a db; add/edit/delete groups; assign a user as group leader, nothing more. I tried http://www.phpclasses.org. There are many options there but I simply don't know which once to go for. I don't have much t...

Find the highest value from a column for each unique value in another column with MySQL

I'm trying to write a MySQL query (from PHP) that will find the newest (highest ID number) score for each unique value in the group column. I've tried a few different combinations of max() and GROUP BY but can't get it to work. Here is an example of my table: ID | my_group | score 1 | red | good 2 | blue | bad 3 | red | bad 4 | blue ...

Raw copy of database leads to `Can't find file:`

To migrate my database faster, I tried copying the raw files (MYD and MYI) files of a database into another machine. All the tables are working fine except two tables that were partitioned. My directory structure looks like this: table1.frm table1.MYI table1.MYD table2.frm table2.par table2#P#p0.MYD table2#P#p0.MYI table2#P#p1.MYD tabl...

mysql get table column names in alphabetical order

Is it possible to query a MySQL database to get the column names of a table in alphabetical order? I know that SHOW COLUMNS `table_name`; or DESCRIBE `table_name`; will give me a list of the columns in a table (along with other info), but is it possible to alter the query in order to get the columns sorted alphabetically. Adding O...

Bad Situation importing/exporting img files - mysql database

I inherited a poorly created mysql database and now I need to migrate data to a new server. Long story short, I need to keep it stored this way and I use phpmyadmin. Know of any tools to help the migration of this 1.2GB mysql table? Hope I don't get slaughtered for this post... ...

MySQL SELECT from PHP

I have one table ( members ) and five columns ( username , password , FirstName , LastName , Email ) I need to get the Email for the user admin. How would this be done? ...

Treat a whole "word" literally in a MySQL regular expression?

I want to do a REGEXP match with MySQL against a variable, like so: SELECT * FROM table WHERE table.CONTENT REGEXP CONCAT('([[:space:]]|[[:punct:]])', table.NAME, '([[:space:]]|[[:punct:]])') This works fine, but it's possible for table.NAME to have regexp special characters in it (e.g. '|'), in which case it gets all screwed u...

INSERT INTO MySQL and PHP

I have a MySQL table ( members ) with six columns ( FirstName, LastName, Email, username, password, Key) I need to insert a string into the Key column for the username admin How would I go about doing this? ...

Getting multiple counts across joined tables

I have 3 related tables: business id name inspection id business_id date violation id inspection_id title I'd like to get out: [business.id, Count(Inspections), Count(Violations)] Where Count(Inspections) is the total number of inspections this business has had and Count(Violations) is the total number of violations...

How to workaround mysql bug: Trigger not executed following foreign key UPDATE/DELETE

MySQL Bug #11472 confirms that when rows of a tableB are updated/deleted indirectly as a result of a FK constraint (relating tableA), triggers on tableB are not executed. How can I workaround this bug? I found a messy workaround, but would like to hear the SO communities suggestions as well. In this example joins has a FK to users a...

How do I balance POST/GET PHP pages for a database message board with SEO-minded static HTML?

Thanks in advance for whoever can help with this question. I have build a messageboard-database using html forms, PHP, and my SQL. The website allows people to post topics and then post messages for each topic. They can then vote up or down on each message. Right now, I do all that through a single PHP page and I use POST. When I u...