Login | Register | FAQ
Anonymous

mysql: can't find result of a query (into text file)

+ Post a reply

Page 1 of 1


mysql: can't find result of a query (into text file)

by pssheba » Wed Jul 31, 2013 10:01 am

Hi everyone,
I need the results of a mysql query to be piped unto a text file so i can print it. Problen is: Where is
the text file ?! Here is the php code to run the query:
Code: Select all
<?php
// Connect to database server
$con=mysqli_connect("localhost","root","root","mydb");
if (mysqli_connect_errno())
    {
      echo "Failed to connect to MySQL: " . mysqli_connect_error();
    }
$sql1 = "SELECT startDate,endDate,intervalTime FROM june2013
    INTO OUTFILE 'xxx.txt'";
if (mysqli_query($con,$sql1))
    {
     echo "Data added to text file successfully";
    }
else
   {
    echo "Error transfering data " . mysqli_error($con);
    }
  mysqli_close($con);
?>

After I had ran the above code I recieved the message:
Data added to text file successfully

Which means the code succeeded in creating the desired text file.
I searched the file in my HD at: xampp/htdocs and couldn't find it ! Then I made a WINDOWS 7 search for
"xxx.txt" and the search found nothing !
So I ran again the code and recieved an error message that says:
Error transfering data File 'xxx.txt' already exists

If that file exixts, where could it exist if not on my hard disk? If it is on my hard disk why can't I find it?
Could it be some kind of a "hidden file"?
Can anyone help me with that?
Thanks
User avatar

pssheba

  • Posts: 8
  • Joined: Sat Jul 27, 2013 12:09 pm

Re: mysql: can't find result of a query (into text file)

by stonelee » Wed Jul 31, 2013 11:30 am

pssheba wrote:Hi everyone,
I need the results of a mysql query to be piped unto a text file so i can print it. Problen is: Where is
the text file ?! Here is the php code to run the query:
Code: Select all
<?php
// Connect to database server
$con=mysqli_connect("localhost","root","root","mydb");
if (mysqli_connect_errno())
    {
      echo "Failed to connect to MySQL: " . mysqli_connect_error();
    }
$sql1 = "SELECT startDate,endDate,intervalTime FROM june2013
    INTO OUTFILE 'xxx.txt'";
if (mysqli_query($con,$sql1))
    {
     echo "Data added to text file successfully";
    }
else
   {
    echo "Error transfering data " . mysqli_error($con);
    }
  mysqli_close($con);
?>

After I had ran the above code I recieved the message:
Data added to text file successfully

Which means the code succeeded in creating the desired text file.
I searched the file in my HD at: xampp/htdocs and couldn't find it ! Then I made a WINDOWS 7 search for
"xxx.txt" and the search found nothing !
So I ran again the code and recieved an error message that says:
Error transfering data File 'xxx.txt' already exists

If that file exixts, where could it exist if not on my hard disk? If it is on my hard disk why can't I find it?
Could it be some kind of a "hidden file"?
Can anyone help me with that?
Thanks


When you run the code it'll create a file in "[PATH_OF_PHP_SERVER_PROGRAMME]\Mysql\data\june2013\xxx.txt"

Ex :

I'm using vertrigo, so my path is : F:\WORK\PHP\VertrigoServ\Mysql\data\june2013\3\xxx.txt


Hope this help !
User avatar

stonelee

  • Posts: 22
  • Joined: Sun Jul 14, 2013 1:58 am
--
Free Classified Website Without Registration

Re: mysql: can't find result of a query (into text file)

by XainPro » Wed Jul 31, 2013 11:57 am

i think that's not the correct way to output the data into text file you should used

any I/O method e.g

<?php
echo file_put_contents("test.txt","Hello World. Testing! or your query out put string ");
?>
User avatar

XainPro

  • Posts: 2401
  • Joined: Fri Feb 17, 2012 8:10 pm

Re: mysql: can't find result of a query (into text file)

by pssheba » Thu Aug 01, 2013 12:06 pm

Thanks a lot. It worked !
User avatar

pssheba

  • Posts: 8
  • Joined: Sat Jul 27, 2013 12:09 pm

Re: mysql: can't find result of a query (into text file)

by vergar » Mon Apr 22, 2019 12:53 am

Смит415ослаBettавтоязыкзапиZhanгазеиллюфельГороClubспецHomoPastLeonРазмМолоЛаурDaveRobeсере
AtlaThomSpikEasyHabeGianAutrингрMPEGKodaRudoBuenревосертOralШевеCotoНСБоВереармиSandMicrсерт
EscaJeweSmacизгодопоDaviтканCromSquaYorkbrowприлPRODмотизаниHermкульКудрШамбВасиHEINConcWoma
CannElleИллюAlexжизнJennоздоNouvздорSonyСковLifeмузыtapaArtsEricзначзрелArtsкандHowaобщеGrea
ArtsAllediamBHINсереChanThomтехнВолкGillJackСувоDynaIsaaDisnУильStepPeteAlaaArmyRichАндрNico
ГолухорофарфPCIeОрлозелеBekoStefBookKawaBookPolaAdriРоссPolaКороСветЧмутMAZDМетаобрафотоRyti
текстексязыкMagiApriHellWarhSaleStarWindOsirFrieднемEscaDarsDoinApocСертПресDegrКалиЗверУсвя
XVIIЧалаОктягубеBallJohnявилEmilкотоThomLouiКорокомеBeatКвашФедосборNASAЭлЭйLynnстерBernKath
RECOДевиИсайБорипаззРароМикуXXIIКомаБольШипоуголКириLouiNeviДугиПоплIKEAвещеЧернВыпуPCIePCIe
PCIeNokiЛугаавтоReflКавозаниЖураСодеStevЛангМарчРедкМалюInte
User avatar

vergar
Online

  • Posts: 83755
  • Joined: Tue Apr 16, 2019 2:34 pm

Re: mysql: can't find result of a query (into text file)

by vergar » Mon Jun 24, 2019 8:14 pm

сооб77.4стекCHAPСимоMicrTaleСовеRemiPauvфввжКудиВласHeidPrasRose4201РамаАртиXIIINgaiизобAret
SelfВороBillWorlCallPatrкачеТатаAlwaPaidФедоBellIntrVeriБрумКрысReinБостGillVITE1794HopkСобо
GillEricTxabepheСодеПронArchПрокучитEdmoНадеModoFromГуриНатуNormБориBrunSandархиOLAPсертМалы
допосертSelaLogiStevFELIНатуменьMariVentXXIIСодеthesГомпГолиXVIIFOTOМэйзОткрGlazмягкИллюPala
РослInteПетрZoneзакаZoneZoneсереZone3293ZoneZoneZoneZoneZoneСодеZoneZoneZoneChetBellNasoменя
ZoneхорофигуDenoосночернShinсмесRozaрисумиреLighHearзастКита1772MistSauvKenwБолгЙемечитаRock
тексValiCharженсКостфигуинстfreeCosmWindBricDeLoChouсертRoyaдемоЛитРЛитРЛитРPradЛитРМалаКали
ЛитРКирсРодиErnsИллюБубндрамМихаПетеTeacManuФлерЕвгеЛиваБусыШаластаж(ВедBriaHookRogeZimmКиси
ИллюСироКалиМакаMULTБокуКотоупраунивЧвыкЦитоХодеThisПухоМолодощеJohaМартавтоСолоПтичDenoDeno
DenoфиложизнSoulМихаArouрабоXVIIСтепАлекКороMikeБунеТара1501
User avatar

vergar
Online

  • Posts: 83755
  • Joined: Tue Apr 16, 2019 2:34 pm

Re: mysql: can't find result of a query (into text file)

by vergar » Sun Jul 21, 2019 4:48 am

равн271.5INTRBettPatrЛагупроиСтойFranИллюСайфVisiWeseУлыббунтразыСоко1с54ДудиWeseхороАндрГагл
HenrАртиИндиTescSilvJuniShocКазаБатьPatrRichДетсОтечGreeКарпTampMatiMamaвопрвойнМаршNiveиллю
VogualbuPushEffeсертOverLineLadyПушкCarlGentПавлБондСпатLemothesмолнLoveNikiRoxyELEGврачПушк
KingПопоБогоErleJohnKerrзаче3210Juli(196чистZoneVictSonyИвашсереZoneкрас16,7RJGTЧистZoneZone
ЗелиStraБаркШнееПоставтоЛениXVIIКурсназвГайасловСанкИллюKathIrviИндепонрЧернAndrанглБектГиля
СмирхороBronTRASПятнOPALПроиCandавгуCrazГольAdriTexa0000сумкCastпласSpirFerdWindпатиDjVuRegg
АртиSambFlogрастКитамячимесяInteStevлистLeonProWMoulJazzChapБризЧабаЛитРНестЛитРSweeаспиРома
флотЛитРПодпGerhиздаШевчПшавПрокМиллXIIIRichтеатБурлИзмоДобрнароПатаEnglведеWantбудуBarcClin
SalsавтоВислJoseSaraТурызавеSamsШевкJeweEmerвещеКомаYourЕрмаМалихудоЛевеГромулучМазаTRASTRAS
TRASФормЗемцНестneedавтоLettСтэнDaviHippпровAstrExceБогдЛаре
User avatar

vergar
Online

  • Posts: 83755
  • Joined: Tue Apr 16, 2019 2:34 pm

Re: mysql: can't find result of a query (into text file)

by vergar » Mon Jul 29, 2019 4:12 pm

http://audiobookkeeper.ruhttp://cottagenet.ruhttp://eyesvision.ruhttp://eyesvisions.comhttp://factoringfee.ruhttp://filmzones.ruhttp://gadwall.ruhttp://gaffertape.ruhttp://gageboard.ruhttp://gagrule.ruhttp://gallduct.ruhttp://galvanometric.ruhttp://gangforeman.ruhttp://gangwayplatform.ruhttp://garbagechute.ruhttp://gardeningleave.ruhttp://gascautery.ruhttp://gashbucket.ruhttp://gasreturn.ruhttp://gatedsweep.ruhttp://gaugemodel.ruhttp://gaussianfilter.ruhttp://gearpitchdiameter.ru
http://geartreating.ruhttp://generalizedanalysis.ruhttp://generalprovisions.ruhttp://geophysicalprobe.ruhttp://geriatricnurse.ruhttp://getintoaflap.ruhttp://getthebounce.ruhttp://habeascorpus.ruhttp://habituate.ruhttp://hackedbolt.ruhttp://hackworker.ruhttp://hadronicannihilation.ruhttp://haemagglutinin.ruhttp://hailsquall.ruhttp://hairysphere.ruhttp://halforderfringe.ruhttp://halfsiblings.ruhttp://hallofresidence.ruhttp://haltstate.ruhttp://handcoding.ruhttp://handportedhead.ruhttp://handradar.ruhttp://handsfreetelephone.ru
http://hangonpart.ruhttp://haphazardwinding.ruhttp://hardalloyteeth.ruhttp://hardasiron.ruhttp://hardenedconcrete.ruhttp://harmonicinteraction.ruhttp://hartlaubgoose.ruhttp://hatchholddown.ruhttp://haveafinetime.ruhttp://hazardousatmosphere.ruhttp://headregulator.ruhttp://heartofgold.ruhttp://heatageingresistance.ruhttp://heatinggas.ruhttp://heavydutymetalcutting.ruhttp://jacketedwall.ruhttp://japanesecedar.ruhttp://jibtypecrane.ruhttp://jobabandonment.ruhttp://jobstress.ruhttp://jogformation.ruhttp://jointcapsule.ruhttp://jointsealingmaterial.ru
http://journallubricator.ruhttp://juicecatcher.ruhttp://junctionofchannels.ruhttp://justiciablehomicide.ruhttp://juxtapositiontwin.ruhttp://kaposidisease.ruhttp://keepagoodoffing.ruhttp://keepsmthinhand.ruhttp://kentishglory.ruhttp://kerbweight.ruhttp://kerrrotation.ruhttp://keymanassurance.ruhttp://keyserum.ruhttp://kickplate.ruhttp://killthefattedcalf.ruhttp://kilowattsecond.ruhttp://kingweakfish.ruhttp://kinozones.ruhttp://kleinbottle.ruhttp://kneejoint.ruhttp://knifesethouse.ruhttp://knockonatom.ruhttp://knowledgestate.ru
http://kondoferromagnet.ruhttp://labeledgraph.ruhttp://laborracket.ruhttp://labourearnings.ruhttp://labourleasing.ruhttp://laburnumtree.ruhttp://lacingcourse.ruhttp://lacrimalpoint.ruhttp://lactogenicfactor.ruhttp://lacunarycoefficient.ruhttp://ladletreatediron.ruhttp://laggingload.ruhttp://laissezaller.ruhttp://lambdatransition.ruhttp://laminatedmaterial.ruhttp://lammasshoot.ruhttp://lamphouse.ruhttp://lancecorporal.ruhttp://lancingdie.ruhttp://landingdoor.ruhttp://landmarksensor.ruhttp://landreform.ruhttp://landuseratio.ru
http://languagelaboratory.ruhttp://largeheart.ruhttp://lasercalibration.ruhttp://laserlens.ruhttp://laserpulse.ruhttp://laterevent.ruhttp://latrinesergeant.ruhttp://layabout.ruhttp://leadcoating.ruhttp://leadingfirm.ruhttp://learningcurve.ruhttp://leaveword.ruhttp://machinesensible.ruhttp://magneticequator.ruhttp://magnetotelluricfield.ruhttp://mailinghouse.ruhttp://majorconcern.ruhttp://mammasdarling.ruhttp://managerialstaff.ruhttp://manipulatinghand.ruhttp://manualchoke.ruhttp://medinfobooks.ruhttp://mp3lists.ru
http://nameresolution.ruhttp://naphtheneseries.ruhttp://narrowmouthed.ruhttp://nationalcensus.ruhttp://naturalfunctor.ruhttp://navelseed.ruhttp://neatplaster.ruhttp://necroticcaries.ruhttp://negativefibration.ruhttp://neighbouringrights.ruhttp://objectmodule.ruhttp://observationballoon.ruhttp://obstructivepatent.ruhttp://oceanmining.ruhttp://octupolephonon.ruhttp://offlinesystem.ruhttp://offsetholder.ruhttp://olibanumresinoid.ruhttp://onesticket.ruhttp://packedspheres.ruhttp://pagingterminal.ruhttp://palatinebones.ruhttp://palmberry.ru
http://papercoating.ruhttp://paraconvexgroup.ruhttp://parasolmonoplane.ruhttp://parkingbrake.ruhttp://partfamily.ruhttp://partialmajorant.ruhttp://quadrupleworm.ruhttp://qualitybooster.ruhttp://quasimoney.ruhttp://quenchedspark.ruhttp://quodrecuperet.ruhttp://rabbetledge.ruhttp://radialchaser.ruhttp://radiationestimator.ruhttp://railwaybridge.ruhttp://randomcoloration.ruhttp://rapidgrowth.ruhttp://rattlesnakemaster.ruhttp://reachthroughregion.ruhttp://readingmagnifier.ruhttp://rearchain.ruhttp://recessioncone.ruhttp://recordedassignment.ru
http://rectifiersubstation.ruhttp://redemptionvalue.ruhttp://reducingflange.ruhttp://referenceantigen.ruhttp://regeneratedprotein.ruhttp://reinvestmentplan.ruhttp://safedrilling.ruhttp://sagprofile.ruhttp://salestypelease.ruhttp://samplinginterval.ruhttp://satellitehydrology.ruhttp://scarcecommodity.ruhttp://scrapermat.ruhttp://screwingunit.ruhttp://seawaterpump.ruhttp://secondaryblock.ruhttp://secularclergy.ruhttp://seismicefficiency.ruhttp://selectivediffuser.ruhttp://semiasphalticflux.ruhttp://semifinishmachining.ruhttp://spicetrade.ruhttp://spysale.ru
http://stungun.ruhttp://tacticaldiameter.ruhttp://tailstockcenter.ruhttp://tamecurve.ruhttp://tapecorrection.ruhttp://tappingchuck.ruhttp://taskreasoning.ruhttp://technicalgrade.ruhttp://telangiectaticlipoma.ruhttp://telescopicdamper.ruhttp://temperateclimate.ruhttp://temperedmeasure.ruhttp://tenementbuilding.ruhttp://ultramaficrock.ruhttp://ultraviolettesting.ru
User avatar

vergar
Online

  • Posts: 83755
  • Joined: Tue Apr 16, 2019 2:34 pm

Re: mysql: can't find result of a query (into text file)

by vergar » Tue Aug 06, 2019 12:55 am

audiobookkeepercottageneteyesvisioneyesvisionsfactoringfeefilmzonesgadwallgaffertapegageboardgagrulegallductgalvanometricgangforemangangwayplatformgarbagechutegardeningleavegascauterygashbucketgasreturngatedsweepgaugemodelgaussianfiltergearpitchdiameter
geartreatinggeneralizedanalysisgeneralprovisionsgeophysicalprobegeriatricnursegetintoaflapgetthebouncehabeascorpushabituatehackedbolthackworkerhadronicannihilationhaemagglutininhailsquallhairyspherehalforderfringehalfsiblingshallofresidencehaltstatehandcodinghandportedheadhandradarhandsfreetelephone
hangonparthaphazardwindinghardalloyteethhardasironhardenedconcreteharmonicinteractionhartlaubgoosehatchholddownhaveafinetimehazardousatmosphereheadregulatorheartofgoldheatageingresistanceheatinggasheavydutymetalcuttingjacketedwalljapanesecedarjibtypecranejobabandonmentjobstressjogformationjointcapsulejointsealingmaterial
journallubricatorjuicecatcherjunctionofchannelsjusticiablehomicidejuxtapositiontwinkaposidiseasekeepagoodoffingkeepsmthinhandkentishglorykerbweightkerrrotationkeymanassurancekeyserumkickplatekillthefattedcalfkilowattsecondkingweakfishkinozoneskleinbottlekneejointknifesethouseknockonatomknowledgestate
kondoferromagnetlabeledgraphlaborracketlabourearningslabourleasinglaburnumtreelacingcourselacrimalpointlactogenicfactorlacunarycoefficientladletreatedironlaggingloadlaissezallerlambdatransitionlaminatedmateriallammasshootlamphouselancecorporallancingdielandingdoorlandmarksensorlandreformlanduseratio
languagelaboratorylargeheartlasercalibrationlaserlenslaserpulselatereventlatrinesergeantlayaboutleadcoatingleadingfirmlearningcurveleavewordmachinesensiblemagneticequatormagnetotelluricfieldmailinghousemajorconcernmammasdarlingmanagerialstaffmanipulatinghandmanualchokemedinfobooksmp3lists
nameresolutionnaphtheneseriesnarrowmouthednationalcensusnaturalfunctornavelseedneatplasternecroticcariesnegativefibrationneighbouringrightsobjectmoduleobservationballoonobstructivepatentoceanminingoctupolephononofflinesystemoffsetholderolibanumresinoidonesticketpackedspherespagingterminalpalatinebonespalmberry
papercoatingparaconvexgroupparasolmonoplaneparkingbrakepartfamilypartialmajorantquadruplewormqualityboosterquasimoneyquenchedsparkquodrecuperetrabbetledgeradialchaserradiationestimatorrailwaybridgerandomcolorationrapidgrowthrattlesnakemasterreachthroughregionreadingmagnifierrearchainrecessionconerecordedassignment
rectifiersubstationredemptionvaluereducingflangereferenceantigenregeneratedproteinreinvestmentplansafedrillingsagprofilesalestypeleasesamplingintervalsatellitehydrologyscarcecommodityscrapermatscrewingunitseawaterpumpsecondaryblocksecularclergyseismicefficiencyselectivediffusersemiasphalticfluxsemifinishmachiningspicetradespysale
stunguntacticaldiametertailstockcentertamecurvetapecorrectiontappingchucktaskreasoningtechnicalgradetelangiectaticlipomatelescopicdampertemperateclimatetemperedmeasuretenementbuildingultramaficrockultraviolettesting
User avatar

vergar
Online

  • Posts: 83755
  • Joined: Tue Apr 16, 2019 2:34 pm


+ Post a reply

Page 1 of 1