PDA

View Full Version : any php mysql wizards on board?


Don-Dad
10-29-2006, 08:59 PM
Help!

I have a bunch of data in a mysql database. I can use phpmyadmin to export certain data I want to extract and save as a csv file.

What I want to do is automate the process using a php script that would run a query and save the data to a csv file.

Any help is much appreciated :)

stretch
10-30-2006, 12:24 AM
You might as well be speaking Klingon to me, Don.

While you're looking, though, can you try find a script that will boot Sao for excessive post count padding?

:D

Will'sdad
10-30-2006, 01:08 AM
sign the map...

jeffus
10-30-2006, 01:54 AM
laughing

tt3
10-30-2006, 01:59 AM
Don't need to find it, just watch me start deleting! :twisted:

Don-Dad
10-30-2006, 02:27 AM
Ummm, did I miss something or has this thread been totally derailed.

This is serious, I need some php/mysql help :mad:

craigbass76
10-30-2006, 11:31 AM
If you can get me to a command line I can get whatever you want. Can I log into the box somehow?

Don-Dad
10-30-2006, 01:09 PM
Any way to write the same commands in a .sh file? I do have shell access.

craigbass76
10-30-2006, 01:20 PM
Yeah!!!!

I'd need a list of the tables you want.
from a bash command line:

mysql --execute="show tables;" dbasename

where dbasename is the name of your database. Give me the resulting output and I can whip up a script for you.

tt3
10-31-2006, 08:33 PM
Don, have you got your question answered or would you like more help? My brother has offered his assistance...

Don-Dad
11-01-2006, 12:27 AM
Craig's been sending things to me in japanese :confused: :rolleyes:

I have to give them a try but if your bro can make a php script that extract data from a mysql database and exports it to a csv, I'm all ears :)

Don

craigbass76
11-01-2006, 01:59 AM
ようこそ、「 トや、 されています !

があっても、それが たりできます ?

Don-Dad
11-01-2006, 03:48 AM
Did you just type "I'll love you long time" ?

jeffus
11-01-2006, 04:09 AM
If I'm not mistaken, that says. "Pull the Beagle from your ass and you will spout wisdom" - eh?! :eek:

I'm a little rough around the edges with my Chinese, so feel free to correct me.....;)

tt3
11-01-2006, 08:10 PM
From me brudda, PM if ya need more info.

.php is a lot like .asp – server side script that can process and return something – usually content of somekind.

I’m sure php can change the content type of the output to specify .csv and force the save, but you could also simply display the text within the browser, then copy/paste into a .txt file and rename it to .csv…

There are some examples of the first – not sure if these would help:

http://www.codingforums.com/archive/index.php?t-38440.html

http://www.webdeveloper.com/forum/archive/index.php/t-34665.html



Let me know if he needs help with the actual sql code to get the right data too.

Hope this helps.

Don-Dad
11-01-2006, 10:21 PM
Thanks, I'm having a look.

MIDAD
11-01-2006, 11:45 PM
Damn, guy's..I built my last pc and thought I was doing something...but that programmin stuff must take a lota book learnin....:confused:

Don-Dad
11-02-2006, 04:40 AM
This crap takes lots of patience and half a brain, that is why I have such trouble.

jeffus
11-02-2006, 04:55 AM
"If I only had a brain!" - :)

Scare-crow to the Wizard....(Of OZ, that is...)