Ok, i have a problem here...
I am sending values of drop down lists via ajax to this PHP file.
Now I want to search a mysql database using these values, which I have managed to do, BUT, only if I set the values to something...
Take a look:
$query = "SELECT * FROM cars_db WHERE price BETWEEN '$cars_price_from' AND '$cars_price_to...
DROP TABLE IF EXISTS `actividades`.`act_actividad_audit`;
CREATE TABLE `actividades`.`act_actividad_audit` (
`fe_creacion` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP,
`usr_digitador` char(10) NOT NULL,
`ip_digitador` char(15) NOT NULL,
`id_act_actividad` int(10) u...
Hey,
I would like to store time data accurate to the centisecond. The mySQL manual states that all stored values will be rounded.
I see two decent options. The time above the decimal place can be stored as TIME, and below the decimal can be stored as a TINYINT. The other option might be to shift all the values up so that HH:MM:SS:cc...
EDIT:
Let me be more specific in what I'm after:
catID, cat1, cat2, cat3, cat4, pri_color,sec_color, and cat_name are all related to each specific category.
The sum_views field should correspond to the sum of all views in the forum for that particular category.
The count_posts field should correspond to the number of posts in the foru...
Hello , in my database i have 10 records with almost exact same data , they differ only by one field ( the field is not in the query) and when i run the following query
SELECT * FROM friends WHERE user_id= 'MyUserName' AND follow_back = 0 AND until_date= '2009-10-13' LIMIT 12
it shows only 9 records , any one stumbled upon similar p...
I have a development MySQL (InnoDB only) server with several users. Each user has access on one exclusive schema. How can I limit the schema size so that each user can use only 1GB (for example)?
...
We have one of our tables in our database that is starting to be pretty big :
10M rows
2.14G for data
3.55G for indices
I was pretty surprised to see that the indices are almost twice as big as the data itself :/
So I showed the indices :
show index from entries;
+---------+------------+----------------------------------------+-------...
I have a function that returns a date string. I need this because I can't use a variable in a view, but I can use a function that returns a variable that I set ahead of time...
So I got all that working, but then I decided that if that I wanted it to return the current date if no date variable was set. I thought the code below wold wo...
Well for whatever reason MySQL does not support subqueries in a View. I'm stuck using MySQL for the forseeable future and I'm needing to write a View to aggregate data from an EAV-style table into a more readable format. The View itself is going to act as the Model for a Ruby on Rails-based application (it's read only so I'm safe using...
Hello - Thank you for taking time to look at my question.
I developing a Java WAR file intended for distribution to only one server at a time. So far, I have tested on 3 different servers with success, one Debian, one Ubuntu and the other, the Windows machine I'm developing on.
On the final deployment server, for some reason the app de...
When trying to install MySQL's python bindings, MySQLdb, I followed the instructions to build and install on my MacBook running Mac OS X 10.6 i386, and after entering the following line into the terminal:
user-152-3-158-79:MySQL-python-1.2.3c1 jianweigan$ sudo python setup.py build
I get the following errors:
running build
running bu...
Hi, I'm working on a basic php/mysql CMS and have a few questions regarding performance.
When viewing a blog page (or other sortable data) from the front-end, I want to allow a simple 'sort' variable to be added to the querystring, allowing posts to be sorted by any column. Obviously I can't accept anything from the querystring, and nee...
I'm finding that the PDO Transaction is only commiting 1 of my 2 SQL statement. For some reason, my PHP script is not inserting into my MySQL database 'homes' table BUT it does insert into the 'invoices' table - even though I'm using a PHP PDO database transaction.
Code below:
$conn_str = DB . ':host=' . DB_HOST . ';dbname=' . DB_NAME;...
I have a SQL statement to select results from a table. I need to know the total number of records found, and then list a sub-set of them (pagination).
Normally, I would make 2 SQL calls:
one for counting the total number of records (using COUNT),
the other for returning the sub-set (using LIMIT).
But, this way, you are really du...
We are Web 2.0 company that built a hosted Content Management solution from the ground up using LAMP. In short, people log into our backend to manage their website content and then use our API to extract that content. This API gets plugged into templates that can be hosted anywhere on the interwebs.
Scaling for us has progressed as foll...
I have Excel spreadsheets stored in a MySQL table longblob field. I need to retrieve this data and then stream it to the user as a downloadable file, preferably without writing it to disk first.
Possible?
Edit - Eh, just figured it out... Posted in answer below.
...
I use PDO prepared statements in a Web application I'm building. I have a timestamp column set to current_timestamp as default value.
Using a timestamp should normally assign the current timestamp when the column value is null, same as now() would do. But no matter what I try, I get a NULL value if I set the timestamp column to null and...
Hello all,
I have a website that calculates a users involvement/activity using multiple MySQL queries.
For a typical user I will ask:
How many updates have they made?
How many photos have they uploaded?
etc etc.
These are just basic COUNT queries on the relevant tables, updates, photos. I then total the COUNT values of each to get a ...
I have a service table. Each service is defined by 1 main category and 1 sub category.
For example,
Service = Joe's Web Company,
MainCategory = Information Technology,
SubCategory = Web Development
Each service offered will have a common set of properties (cost, location etc)
Each service will also have a set of attributes specific...
I am changing my db so that certain fields can be longer. Right now they're "varchar(255)" can I just increase that to "varchar(500)" or are there special rules for dealing with this and I should make them "text"?
...