|
May be But i want all the filtered record in my hard disk.
So i am getting all the records and then saving it in a file (csv).
I am using iframes for this.
What i want is a file saved in my hard disk (filtered records).
Is there any other way to do this.
|
|
|
|
|
Google for scripts to export mysql records as a csv, either way it will be just as slow, you have to increase the timeout or split it up into multiple csvs, then build an application to join it into one large csv.
Either way, no you cannot export 10,000 records in one shot while youre timeout is set to 30 seconds, you will need shell access to do this to bypass php.
Edit: next time post your requirements in the OP so we don't do this dance for an hour before I understand what it is you really want.
|
|
|
|
|
"select * from table1 limit 2,3" should display only 2 records but
i am seeing 3 records.Starting from record 2 to next 3 records.
You said i can go for Google script.Please explain me about it.
|
|
|
|
|
Sorry, will show next 3 records starting at record 2
LazyDragonfist wrote: You said i can go for Google script.Please explain me about it.
$host = 'localhost';
$user = 'mysqlUser';
$pass = 'myUserPass';
$db = 'myDatabase';
$table = 'products_info';
$file = 'export';
$link = mysql_connect($host, $user, $pass) or die("Can not connect." . mysql_error());
mysql_select_db($db) or die("Can not connect.");
$result = mysql_query("SHOW COLUMNS FROM ".$table."");
$i = 0;
if (mysql_num_rows($result) > 0) {
while ($row = mysql_fetch_assoc($result)) {
$csv_output .= $row['Field']."; ";
$i++;
}
}
$csv_output .= "\n";
$values = mysql_query("SELECT * FROM ".$table."");
while ($rowr = mysql_fetch_row($values)) {
for ($j=0;$j<$i;$j++) {
$csv_output .= $rowr[$j]."; ";
}
$csv_output .= "\n";
}
$filename = $file."_".date("Y-m-d_H-i",time());
header("Content-type: application/vnd.ms-excel");
header("Content-disposition: csv" . date("Y-m-d") . ".csv");
header( "Content-disposition: filename=".$filename.".csv");
print $csv_output;
exit;
?>
modified on Monday, February 2, 2009 11:11 AM
|
|
|
|
|
no it showed 3 records.
Now i am trying the script you had given.
Thanks for that.
I hope works.
|
|
|
|
|
Sorry, like I said I had a brain freeze decided to test your knowledge , in limit the first number is your starting record and the second number is how many records to gather after that point, so limit 200,100 would get you records 200 to 300 inclusively.
|
|
|
|
|
That script will STILL timeout unless you connect to mysql manually through a command line and bypass php, that script will only work if you up the timeout php allows.
|
|
|
|
|
Thank you very much.
Its working.
Can i have you email so that.
|
|
|
|
|
|
Just i want to make a good friend.Even i have many more doubts which
is taking a long time posting here.So if you give you email we can go
through chat (yahoo,live,etc...).
That too I don't have a friend who have stuff(strong knowledge).
Of course i am also not bad.And i want to talk many more,here is the not
right place to talk.
|
|
|
|
|
Here is the PERFECT place to talk. You will get input from an array of people using different practices, with stronger knowledges is certain areas. You can get the best of all worlds by posting here instead of just getting input from one person.
So no, if you have something to ask, ask it here. It is the best place to ask.
Don't forget, you got your answer to your question by posting here, why stop doing that
|
|
|
|
|
May be you are right.This is the best place i accept but getting
response took 1 day that is why i said that.
Any way thanks for the help.
I have another doubt with php.
that is can we run php for life time?
i want to run a php that checks the site www.example.blog.com(say) and copy
newly add file to the site to my site.
I tried to call php from another php using curl and made it run 3 hours but
did helped to complete my task.
Have any idea.
|
|
|
|
|
LazyDragonfist wrote: but getting
response took 1 day that is why i said that.
As if I would be on call to help you at your leisure is feasible... yeah right.
LazyDragonfist wrote: I have another doubt with php.
that is can we run php for life time?
i want to run a php that checks the site www.example.blog.com(say) and copy
newly add file to the site to my site.
Start a new thread, and rephrase your question with proper English so I can understand it.
Before you post, consult with Mr. google[^] and RTFM[^] so you can give it a try before you post. No one here will do your coding for you, only point you in the right direction.
|
|
|
|
|
I don't want other do my coding.
i was just asking where i am going wrong that it.
I will start a new thread for that.
This time i will see my English.
i understood one thing from your code that query for
the filter was not good.i am able to download 10000 records.
But fails when i apply filter to that.
Can you see the Query and tell me what is wrong please.
i have 4 table champs(Champion Ships),teams(team),matchs(matchs played),rag(scores)
I hope the below Query will be understandable.
SELECT date,(select champname from champs where champid=matchs.champid) AS ChampionShip, matchs.round AS Round, (select teamname from teams where teamid=matchs.home) AS home, (select teamname from teams where teamid=matchs.away) AS away, HomeOdds,AwayOdds,DrawOdds, rag.goalno AS NoOfGoals, (select sum(rag.home) from rag where matchid=matchs.matchid) AS HomeGoals, (select sum(rag.away) from rag where matchid=matchs.matchid) AS AwayGoals FROM matchs, rag WHERE rag.matchid=matchs.matchid And rag.goalno=(select max(goalno) from rag where matchid=matchs.matchid);
|
|
|
|
|
That might be better off in the database section as it's a SQL related question, not a PHP related question, again start new threads, this one is going off topic and out of control.
|
|
|
|
|
Ok,
Thanks you for every thing.
|
|
|
|
|
EliottA wrote: Before you post, consult with Mr. google[^] and RTFM[^] so you can give it a try before you post.
Well put Do you think we could get Chris to put something like that at the top of every forum?
Regards,
--Perspx
"A refund for defective software might be nice, except it would bankrupt the entire software industry in the first year." -Andrew Tanenbaum
"Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer." -Fred Brooks
|
|
|
|
|
Something like that exists in the C# and VB.Net sections, I don't see why it's not in the PHP board too. Put it in the suggestions board, I'm sure it will go under consideration, assuming it's not in the to-do already.
|
|
|
|
|
Well put Poke tongue Do you think we could get Chris to put something like that at the top of every forum?
Regards,
--Perspx
What you guys are thinking are not right.No one here come and
posts with out trying it in google and other tutorials.Of course for
you smart guy its very silly and easy.Here people come when there are
no other ways to find solutions to their problem.
Regards,
Pavan.
|
|
|
|
|
LazyDragonfist wrote: No one here come and posts with out trying it in google and other tutorials
Really..? No-one? Jeez, a hell of a lot of answers to questions I've seen here are simple, bog-standard, type it into Google sort of things..
Regards,
--Perspx
"A refund for defective software might be nice, except it would bankrupt the entire software industry in the first year." -Andrew Tanenbaum
"Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer." -Fred Brooks
|
|
|
|
|
Well put Poke tongue Do you think we could get Chris to put something like that at the top of every forum?
Regards,
--Perspx
What you guys are thinking is not right.No one here come and
posts with out trying it in google and other tutorials.Of course for
you smart guy its very silly and easy.Here people come when there are
no other ways to find solutions to their problem.
Regards,
Pavan.
|
|
|
|
|
I disagree, a lot of people come here without searching google or the documentation.
|
|
|
|
|
I am running a website where i require uploaded word document to be shown on the fly on the particular poages. , but i dont have a php script that converts .doc file contents to html .
Please help me out.
Regards
Jude Dcoutho
judedcoutho@gmail.com
|
|
|
|
|
It's good news for python developers.. !!!
It is good, To started python message board.. on codeproject ..
I m too happy
Thanks
Pavan Pareta
modified on Thursday, March 12, 2009 9:41 AM
|
|
|
|
|
I didn't realize that we had a Python formum.
I'll have to start watching it, as Python is my second favorite language after C++.
Later,
Mike
|
|
|
|