mysql

Does a php folder management script exist?

Basically, I want to upload about 10,000 family photos that have been organized into folders according to names of the people involved. What I'm looking for is php driven software that allows me to put passwords on each of the folders initially and then allow the family members themselves to manage their folder by adding additional usern...

How much SQL Query is too much SQL Query?

I was researching for a CMS to use and ran into a review on vBulletin 4.0; using about 200 queries on one page load. I was then worried. Further research brought me to other sites to see how much queries they are using and I found that some forum software such as Invision Power Board and PHPBB are using queries as low as 6 or 8. Curre...

Large Comparison - MySQL AND PHP

I've developed a user rating system that takes analyzes a users and saves their information with a score in a db. I'm getting close to 1 Million users rated and stored. I'm having issues with taking a certain set of users from the table (score < 50) and then comparing their ids against another set of ids without the whole thing crashi...

How to loop through array of database rows, and select the first with desired value?

I have an array of fields (not rows!) I want to loop through, in a table, in a predefined order, backwards (alternatively, I could reverse the order of the array) and return the field name of the first field that returns a predefined value. For example, the fields are like this: field_a => 1 field_b => 0 field_c => 1 field_d => 0 field...

is it possible to compare a mysql TIMESTAMP to a millisecond?

For reasons that are too obscure to get into, I have a millisecond representation of a specific time and I have a mysql database filled with mySql Timestamps and I'm curious if it's possible to just do native comparisons in sql such as select * from myTable where time_stamp_column > 1264665600000; or something along those lines. I've ...

Clojure MySQL Syntax Error Exception ("[...] near '????????????????' [...]")

Hi there, I'm having trouble doing anything with clojure.contrib.sql beyond establishing a connection. I have a mysqld running on localhost:3306 with a database called clj_db. The user 'clj_user'@'localhost' with password 'clj_pass' can access this database. When trying to "select * from clj_table" I get a "com.mysql.jdbc.exceptions.M...

What's the best way to manipulate the way entries in a data base are displayed on my web page?

I have a client I am building a small CMS for. One of the functions is that he would like to be able to pick the order in which images display on a page. In my mySql Database I have a table called image_info with the fields: index (auto incremented) img_url img_link I was thinking of adding an additional field called img_order whic...

How to fix this simple MySQL display order issue

I'm very new to MySQL so I need some help please, I have a table called "posts", this table has the following columns: id - this is auto increment and primary key title content I have a PHP page where I want to display all the posts from the database table. I want the title to show first and then the post content followed by the title...

Multi column dynamic PHP list.

So what I'm trying to do is select all the distinct months from my database and then print them in a list. That, I can accomplish. The problem lies in the fact that I need my list to be two column. The way that I achieve this with CSS is by using 2 different div's "left" and "right" which are floated next to each other. This poses a prob...

Best practice question for MySQL: order by id or date?

This is kind of a noobish question, but it's one that I've never been given a straight answer on. Suppose I have a DB table with the following fields and values: | id | date_added | balance | +------------------------------------+ | 1 | 2009-12-01 19:43:22 | 1237.50 | | 2 | 2010-01-12 03:19:54 | 473.00 | | 3 | 2010-01-12 0...

Any advice on parsing an OPML file with PHP so I can import the addresses into a mySql database?

I want to be able to have the user select an OPML file that contains a large number of bookmarks, then loop through each one and toss it in a mysql database. Any direction would be much appreciated. ...

help...! same page file upload to mysql...

hey so i decided against using uploadify as i could not get any help on it. i've been now trying to implement a simpler solution. but unfortunately i cannot seem to process the upload code on a single page without receiving the following error: Warning: fopen() [function.fopen]: Filename cannot be empty in C:\xampp\htdocs\speedy...

How to limit the display of content from a database?

I am using the following code to display the title and body content of articles from a database. How can I make only the first 200 characters from the article's body appear as opposed to all the characters? <?php $select = mysql_query("SELECT * FROM articles ORDER BY id DESC"); while ($result = mysql_fetch_assoc($select...

how to insert am pm in a time datatype filed in mysql

i want to save a library all 7 days open time and close time please suggest how to do it... right now i m doing like this on database i crate a db table_lib_hours -----FIELD-----x--TYPE---------- |day_id |INT | |day_name |varchar(100) | |day_open_time |TIME | |day_close_time|TIME | |last_update ...

CouchDB for a forum?

Will couchDB be better for storing the forum posts/topics then MySQL? assuming there is proper caching (i.e memcached being used). It seems at first glance that CouchDB is made for this, the whole document orientated design fits perfectly but I'm more concerned about performance. Any suggestions? ...

Can we fetch an added image from MySql database by using java?

I have added an image into a MySql database. And I am trying to fetch the image from the database by creating a new file by using java. The problem is that everything goes fine and image file has been created but the image file doesn't contain the image, it has just nothing and the size of the new created image file differs from the orig...

Optimzing MySQL many to many query

Hi, I've having problems getting MySQL to use indexes on a many to many query, i have pasted the relative information below. EXPLAIN SELECT * FROM interviews JOIN interview_category_links ON interviews.id = interview_category_links.inter_id JOIN categories ON interview_category_links.cat_id = categories.id WHERE categories.category_sa...

InnoDB takes over an hour to import 600MB file, MyISAM in a few minutes

I'm currently working on creating an environment to test performance of an app; I'm testing with MySQL and InnoDB to find out which can serve us best. Within this environment, we'll automatically prepare the database (load existing dumps) and instrument our test tools. I'm preparing to test the same data dump with MySQL and InnoDB, but ...

MySQL Install: ERROR: Failed to build gem native extension.

I'm trying to get MySQL installed to the latest version due to some installation going wrong somewhere along the line. I run the command gem install mysql and I receive the following: Building native extensions. This could take a while... ERROR: Error installing mysql: ERROR: Failed to build gem native extension. /S...

MySql Query: ordering by two fields in two tables

Hi everybody, I have two tables storing members data members: id, field1, field2 and field3... members_extra: memberId, someExtraField1 and someExtraField2 members_extra.memberId is a Foreign Key referencing members.id 'members_extra' may or may not have related rows for rows in 'members' let's say: I have 1000 members in 'members...