What is the php script for converting a mysql table to text file? I have converted it to CSV format which opens up as a excel file. I also want the table data in a text file. How do I do it?
For converting it to csv format, I used the header data as:
$filename = "export_".date("Y-m-d_H-i",time());
header("Content-type: application/vnd...
I am currently building an ecommerce site with PHP/MySQL. Recently, I have been working on the Shopping Cart integration. The client wanted to ensure that stock was available to potential buyers, so I created a stock management system. The shopping cart works as follows:
Client adds a quantity of an item to
his cart.
Item quantity ...
Hi,
I have a recovery disc image which contains the datafiles for mysql server. The original server is unavailable - all I have is the datafiles (programdata, program files etc). I am not able to make a mysqldump file.
On the new server, I've installed the exact copy of mysql server, and copied the files/folders (all the myd myi file...
After installing Snow Leopard I got the following error when connecting to a remote MySQL server:
mysqlnd cannot connect to MySQL 4.1+ using old authentication
What I don't get is why it's working fine with MAMP when I only start MAMP's Apache, but I get this error with Snow Leopard's build in Apache. Is it because MAMP has some MySQL ...
Hi folks,
I read all posts on HTTP over SSL. So far, I know how to get the data securely in a Web form. But I miss the part of recover and keep the data in the same way.
I need in my Website a form to collect sensible data from customers (may be also credit cards numbers for booking, but no credit card authorization process is required...
Hi,
I found EXPLAIN SELECT query very useful in MySQL because it gives information on how SQL will be executed and gives the opportunity to analyze, for e.g., missing indexes you should add in order to improve response BEFORE doing the query itself and analyzing stats.
My question is: In databases like MS Sql, Firebird, Ingres, is ther...
I tried for about 3-4 hours trying to get the mysql gem to install for ruby 1.9.1 on snow leopard. The mysql gem used to work just fine on 1.9.1 before I upgraded to snow leopard. I uninstalled MySQL server and gem from my machine. I then downloaded and installed: mysql-5.1.37-osx10.5-x86_64.dmg. I have been able to assert that this ...
Hello,
Given the following tables, how can I search for a term in each of them and order results by relevance? Thank you.
bands
- band_id
- band_name
albums
- album_id
- album_name
songs
- song_id
- song_name
...
Hi Guys, I want to know when and where we use PDO's other than simple mysql_connect methods?
Is this PDO is faster ?
what are the advantages over other methods?
...
Hi,
I have a query that gets a result, limits it and then does a sort around the limited results. Something like:
(SELECT SQL_CALC_FOUND_ROWS * FROM table ... ORDER BY score DESC LIMIT 0,15) ORDER BY name ASC;
Using
SELECT FOUND_ROWS() AS total
after will always return 15 due to the sub sort. Is there a way around this?
Thanks!...
access is connecting to a mysql database. the rowsource of one of a listbox is:
SELECT...FROM something INNER JOIN...
i cannot find this 'something' anywhere. does it have to be a table?
...
I'm trying to list all my products' description according to a specified language, and if no translation is found for that language then the default is taken instead.
Please take a look at this paste, everything is explained with the expected results:
http://pastebin.com/m306e670c
I've been working on this for days, so your help is...
i am connecting access to a mysql db.
i need to put together two statements and make them into one.
for example:
SELECT
users.id,
users.first,
users.last,
chavrusas.luser_type AS user_type,
chavrusas.id,
users.title,
users.city,
users.state,
users.home_phone,
users.email
FROM users
INNER JOIN chavrusas
ON ...
Hello folks,
I'm trying to build a searchable database of acronyms and their definitions that are specific to a certain industry. It has been years since I've done any real programming, so I'm a little behind the learning curve.
I'm writing the code in PHP, and I'm using MySQL as the database. If this can be done easier in Postgres, ...
How to access the row which has just been inserted into a DB with PHP/MySQL?
I have:
$sql = 'INSERT INTO `jos_db`.`jos_sections` (`id`, `name`) VALUES (NULL, \'foo\')';
mysql_query($sql, $dbi);
bar();
How do I access the new row in bar()?
...
i have a huge sql query that is attached to the rowsource of a listbox.
the SQL statement seen here:
http://stackoverflow.com/questions/1358642/ms-access-select-from-another-query
actually returns the correct information if that information is under 2 records.
however if it returns more than 2 records it still populates the listbox...
There are a lot of SQL Top N questions on stackoverflow but I can't seem to find one that matches the situation I'm having. I would like to perform some grouping within a top n query. My data looks like this (obviously with fake values).
MY_DATE IP_ADDRESS
1/1/09 999.999.999.999
1/1/09 999.999.999.999
1/1/09 999.999.999...
I have a MySQL database with one particular MyISAM table of above 4 million rows. I update this table about once a week with about 2000 new rows. After updating, I then perform the following statement:
ALTER TABLE x ORDER BY PK DESC
i.e. I order the table in question by the primary key field in descending order. This has not given me a...
I have a web-app that was done in Rails 1.2.3 and I have just migrated it to rails 2.2.2 and upon deploy the app broke. It turns out I needed to install the MySQL gem since rails 2.2.2 needs this.
So, I did install it but I had to install with "sudo gem install mysql -- -with-mysql-config" (as per http://brantinteractive.com/2007/02/16...
I'd like to calculate some simple statistics (percentages) from a table in mysql. The table in question has the following pseudo-schema:
TABLE: coupons
couponId (int)
couponType (int)
customerId (int)
sentOn (datetime)
visitedOn (datetime)
purchasedOn (datetime)
This table tracks unique coupons sent to customers, when they were sent, ...