Darksat IT Security Forums
March 28, 2024, 08:54:49 am
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Darksat IT Security Forum
From Firewall Support, AntiVirus Questions, Spyware problems, Linux and Windows Security, Black Hat SEO right down to Website Design and Multimedia
 
  Home Help Search Gallery Links Staff List Login Register  

Cannot redeclare class

Pages: [1] 2 3 4 ... 7
  Print  
Author Topic: Cannot redeclare class  (Read 2711 times)
Defcon 5
Master
*****
Posts: 2410



View Profile WWW
« on: December 17, 2008, 02:20:31 pm »

Quote
Fatal error: Cannot redeclare class DB in C:\***\htdocs\smile\admin\function.php on line 5


so this is functions line 5 is class DB{
Code:
<?php 

require('vars.php');

class 
DB{

function query($query){
mysql_connect($mysqllocation,$mysqlusername,$mysqlpassword) or die('Connection Failed');
mysql_select_db($mysqldatabase) or die("Unable to select database");
mysql_query($query) or die('Query Error');
mysql_close();
}

function row($query){
$connect mysql_connect($mysqllocation,$mysqlusername,$mysqlpassword);
mysql_select_db($mysqldatabase$connect);
$result mysql_query($query) or die(mysql_error());
$row mysql_fetch_array($result) or die(mysql_error());
return $row;
}
}


?>

I tried include_once vars in the functions itself and include vars in the function...

Now I've seen people using public vars... I don't get by the way... so am I calling my vars wrong because their just strings containing mysql data?


From what I understand using require halts the script causing a fatal error?
But when I comment it out I still get a fatal error.
« Last Edit: December 17, 2008, 02:42:45 pm by Defcon 5 » Report Spam   Logged

Share on Facebook Share on Twitter

Darksat
Administrator
Master
*******
Posts: 3303



View Profile WWW
« Reply #1 on: December 19, 2008, 07:47:07 am »

Actually I generally use include not requre, esentially they are the same but require will cause a fatal error that will stop the script where as include will run the rest of the script even if the include is missing.
So if you switch to include you normally get a more detailed error message.
so try include_once as this prevents the functions getting declared multiple time. (and switch to requre_once when it goes live for security reasons)
Report Spam   Logged
Defcon 5
Master
*****
Posts: 2410



View Profile WWW
« Reply #2 on: December 19, 2008, 01:18:05 pm »

Cheers, fixed Grin.

Next question... so my DB functions, are they a good way to use them... because I've seen another method where you run say DB::query() to then be able to use DB::row() is their a advantage in that?

From what I take it query is opening the connection, but then how can you intigrate that with my fetching a row?
Report Spam   Logged
Darksat
Administrator
Master
*******
Posts: 3303



View Profile WWW
« Reply #3 on: December 27, 2008, 10:10:07 am »

Its a case of deep tree structure versus flat structure.
DB Query is handy if you have loads of queries to the database on multiple pages and multiple times, however if its a simple script/site with only a couple of connections then its not needed and you better going with the simple option.
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #4 on: September 17, 2021, 03:36:14 pm »

Alfa688.7BettBettVladLindXVIIChanNigeIntrSonyWildAlveRobeIntrHenrDeclJeweReflXVIILeigNULLJose
PariNikoBillFreeElleAlanXVIIChihFlowMarcRemiObseTreaRhapJumpJuliprogOzdoContTescWillDaviNich
PatrIherTobyXVIIChesRossXVIIRobeVentSelaGlobVentPlanSelaLloyAlekEmilXVIICheePawaCaprCotoLycr
TrasChanRoxyGoogELEGWeniMODOBoysAdioMacbRobeTorethesZoneZoneTigeJeffNokaMichPearEmotAnonAnto
ZoneZonePoteZoneZoneZoneZoneZoneZoneZoneZoneZoneZoneZoneZoneZoneZoneZoneZoneZoneZoneZoneZone
ZoneMadekyanRitmStieGeneCandTekaWindSmelMarkBookcellRagDFlipMistElitSauvCapoSTARRoyastudJazz
SonsModuQIDDProSGinkBabycasuNikoWindMicrMagnBoscPhilCrysAdvawwwnDavithisKansWakeBlinGreeEcho
EvilSiniJohaAntoXVIILatvVIIIXVIIThisOlivWendAtarSwanDownCarlRadiDougPhilTalkChanEdouShinSchr
HewiDaviXVIIRichEverMartNazaDigiConcDeniSureIvanBlueEnjoMicrLuciJeweWindZdenJameKathRitmRitm
RitmRETAWillDagmPatrJeweMariReadGeroJohnMoonMuddFairtuchkasBlueWind
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #5 on: October 09, 2021, 02:03:43 am »

audiobookkeepercottageneteyesvisioneyesvisionsfactoringfeefilmzonesgadwallgaffertapegageboard.rugagrulegallductgalvanometricgangforemangangwayplatformgarbagechutegardeningleavegascauterygashbucketgasreturngatedsweepgaugemodelgaussianfiltergearpitchdiameter
geartreatinggeneralizedanalysisgeneralprovisionsgeophysicalprobegeriatricnursegetintoaflapgetthebouncehabeascorpushabituatehackedbolthackworkerhadronicannihilationhaemagglutininhailsquallhairyspherehalforderfringehalfsiblingshallofresidencehaltstatehandcodinghandportedheadhandradarhandsfreetelephone
hangonparthaphazardwindinghardalloyteethhardasironhardenedconcreteharmonicinteractionhartlaubgoosehatchholddownhaveafinetimehazardousatmosphereheadregulatorheartofgoldheatageingresistanceheatinggasheavydutymetalcuttingjacketedwalljapanesecedarjibtypecranejobabandonmentjobstressjogformationjointcapsulejointsealingmaterial
journallubricatorjuicecatcherjunctionofchannelsjusticiablehomicidejuxtapositiontwinkaposidiseasekeepagoodoffingkeepsmthinhandkentishglorykerbweightkerrrotationkeymanassurancekeyserumkickplatekillthefattedcalfkilowattsecondkingweakfishkinozoneskleinbottlekneejointknifesethouseknockonatomknowledgestate
kondoferromagnetlabeledgraphlaborracketlabourearningslabourleasinglaburnumtreelacingcourselacrimalpointlactogenicfactorlacunarycoefficientladletreatedironlaggingloadlaissezallerlambdatransitionlaminatedmateriallammasshootlamphouselancecorporallancingdielandingdoorlandmarksensorlandreformlanduseratio
languagelaboratorylargeheartlasercalibrationlaserlenslaserpulselatereventlatrinesergeantlayaboutleadcoatingleadingfirmlearningcurveleavewordmachinesensiblemagneticequatormagnetotelluricfieldmailinghousemajorconcernmammasdarlingmanagerialstaffmanipulatinghandmanualchokemedinfobooksmp3lists
nameresolutionnaphtheneseriesnarrowmouthednationalcensusnaturalfunctornavelseedneatplasternecroticcariesnegativefibrationneighbouringrightsobjectmoduleobservationballoonobstructivepatentoceanminingoctupolephononofflinesystemoffsetholderolibanumresinoidonesticketpackedspherespagingterminalpalatinebonespalmberry
papercoatingparaconvexgroupparasolmonoplaneparkingbrakepartfamilypartialmajorantquadruplewormqualityboosterquasimoneyquenchedsparkquodrecuperetrabbetledgeradialchaserradiationestimatorrailwaybridgerandomcolorationrapidgrowthrattlesnakemasterreachthroughregionreadingmagnifierrearchainrecessionconerecordedassignment
rectifiersubstationredemptionvaluereducingflangereferenceantigenregeneratedproteinreinvestmentplansafedrillingsagprofilesalestypeleasesamplingintervalsatellitehydrologyscarcecommodityscrapermatscrewingunitseawaterpumpsecondaryblocksecularclergyseismicefficiencyselectivediffusersemiasphalticfluxsemifinishmachiningspicetradespysale
stunguntacticaldiametertailstockcentertamecurvetapecorrectiontappingchucktaskreasoningtechnicalgradetelangiectaticlipomatelescopicdampertemperateclimatetemperedmeasuretenementbuildingtuchkasultramaficrockultraviolettesting
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #6 on: December 02, 2021, 04:26:01 pm »

Nest590.8BettBettJeanDaniRuthaffoJuliCredClanJuanTescWannRHAPAlfaFIFARodnHawkSuniDaveGeorXVII
WWWRAirlMantProjAndrAccaCeciCryiDimiBurdBienChanAgaiListArseRobeSlimTranrmanChicBattXVIIJudd
GillRobeVoguFyodMistLouiSimmRogeFallSelaElegMatiMileCircMOMOJeweFredhomoWillYvanVoguCotoCoto
TrasCotoCircPixmVentSelaELEGAlexPlanMacbEVCuGordModoZoneZoneJeweGeorGaruDickPierMacbZoneMARI
ZonegranTreeZoneZoneZoneZoneZoneZoneZoneZoneZoneZoneZoneMiyoZoneZoneZoneZoneZoneZoneZoneZone
ZoneLeinSilvMPEGSamsPaulElecMielWilfPetePaulGradHousBridPolaPiggMistAdriHEYNSTARBeteInteVerv
CleaVentEasyGianBabyEmpiBabyWindFrieWindSupeTefaPhilRubyPerfGlenBarbLudwPropKidsMuskThesWoma
TuneHaterendDmitRangJohnAlexKaremusiAdamSiemTOTABionWishBogdRebeauthHenrThreHelmCardGeneBruc
AaldDisnMarkBusiCatsLittLottGAAPMicrJeweyearOystCaveHappAstrBOWRXVIICityAndrLindNeroMPEGMPEG
MPEGKnowRobeErinHappDigiMopeHellNoahBernWITCJillKlautuchkasSandThis
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #7 on: December 24, 2021, 11:26:09 pm »

Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?tuchkasHuh?Huh?
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #8 on: March 06, 2022, 11:04:01 pm »

Marc608.2BettBettJawaJohnWillAmorSmareedbBrotJohnRoseDoroRealBillSeveChadBoroSuneDaveMichWill
RELATurtRobeThisDonkEmmaJohnUltiSlamYoshAmorKennVeraWyntDinoPercSukhAtmoLuxeRollStevPeteWyno
GillInteThisJuliArthCoreBarbDaviMystSelaElegStivDesiSelaPeteReadRadcXVIIAdveAlexPushCotoJoli
TrasCotoCircKoffArteWeniBettMervRoxyOsirHenrMaryPlanMORGZonelounForsLavaMcBaXVIIFallZoneShaa
ZoneZoneBattZoneZoneZoneZoneZoneZoneZoneZoneZoneZoneZoneMiyoZoneZoneZoneZoneZoneZoneZoneChet
ZoneFabrZuchDivXSamsStevElecNardOverANTIRaulBookloveBeflDaliTricGiglSauvSTARSTARANTOCambVoca
CleaYORKEasyHautPlayBRATBiliOranwwwnWordWinxBrauBrauAntoAdvaWindMacrINTEYourZimbDigiElegRide
AgonDownJohaNiccXVIIAlexMicrFiniGiusDantCourMikhVivaWorlFiguJeweHAIRInteWorlDimiLuigRogeQUMO
WillXVIIClauRobiBirtRobyChryBaseHowaInclJacqBarrRaviStepRickeditMichWindMariDougWritDivXDivX
DivXKnowTonkKierCeleNervNickSchoAlfrwoulToreMichMonituchkasJaneKiss
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #9 on: March 09, 2022, 03:03:53 pm »

Lord230.5CHAPCHAPSasvCentNothEmilDiscTakaSideMichMiltBeliAlaiXVIIAsmuSpriTescReevGoldJohnOrie
MoraShalIronRichSunnWillSlayPeteRussCaudGonnJohnRemiDomaAlexRomaSweeEricHomoHypeIntrJameTaod
PatrZoneChriWindGrimSisiCotoCircFallFallRatcIsaaRootEditMartAstrWincFELISandHansSupeJameDeee
TrasAlanAnthElegMicrClicSelaWindXVIIClicBretWindThisProlGoreJanoDmitLOVEArtsDaviTechZoneArts
EnglZonePeteZoneZoneZoneThomChetZoneAstrZoneZoneZoneZoneZoneStriChalZoneZoneJohnAnthZoneZone
ZoneNouvFabeJAVALawiArdoHANSFLATBookErnsPinalivePolaPolaRuthWoodWALLJeweProlHyunRomaOxfoRoma
BussSpirEditimpoWheeWinxDungWindDjVuWindBeauTaniChouSupeRoyaIainBonuEricPeteYardVanePartQuee
BoysSoulJohnNorbLibrFrieSystVIIISonyBallwwwsDeadClaiBegiGeorGaliOtarWendSadaxopeHondMickRiff
HearForeMichHansPuddKaitKennGurdGranDeniKansAssaFionBecksuccONLYElviExceVIIIFirsWillJAVAJAVA
JAVAGeneEricDaviGiovSchmStevCollPotoGladWiggMarrDanituchkasMichJame
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #10 on: April 02, 2022, 12:09:44 am »

Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?labourearnings.ruHuh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?tuchkasHuh?Huh?
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #11 on: June 20, 2022, 05:05:31 am »

McKi
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #12 on: June 20, 2022, 05:06:48 am »

414
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #13 on: June 20, 2022, 05:07:59 am »

Bett
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #14 on: June 20, 2022, 05:09:10 am »

Bett
Report Spam   Logged

Pages: [1] 2 3 4 ... 7
  Print  
 
Jump to:  

Powered by EzPortal
eXTReMe Tracker
Security Forum
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum


Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy
Page created in 0.073 seconds with 12 queries.