The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Damn Classes /; (the php type)
ok, im working on a vb free site and im setting up a code so that inorder to write/read a query i need to only type
PHP Code:
PHP Code:
PHP Code:
why isent this working? ill give you my current error: Quote:
Quote:
Ty in advance ~Cody Woolaver |
#2
|
|||
|
|||
$this should only be used inside methods AFAIK...
*I'm still very new to OOP* |
#3
|
|||
|
|||
Im new aswell ^^
umm, so, where what should i put it inside of? |
#4
|
|||
|
|||
Well that function isn't even in your class, you're defining a class with no methods in it. I don't know if the below will work as I haven't tested it....nor am I an OOP guru, as I am still learning myself.
PHP Code:
|
#5
|
|||
|
|||
Update of code:
PHP Code:
Quote:
Quote:
|
#6
|
|||
|
|||
Your closing the class before defining any methods, you have to wrap the closing bracket "}" at the end of all you methods.
|
#7
|
|||
|
|||
yeah, i had a feeling that was an answer
Updated Script PHP Code:
Quote:
Quote:
|
#8
|
||||
|
||||
you can not run a function or set a var when initialzing it, except for setting it as an array. if you want to set that var as mysql_connect create a constructor function at the beginning of your class.
|
#9
|
||||
|
||||
Just to build on AN-nets excellent pointer:
PHP Code:
|
#10
|
|||
|
|||
so, after that, is there anyhting else i need to do? or did i have a whole bunch of shit in mine that wsent neded?
---- ok, scrap what i just said i am completely lost, can you guys amke me an example? that fully works! i want to type PHP Code:
you should see all the backup files ive made for this project.. lol.. ig to about 20... and none of em work! i just need this made, idc how much space it takes! i really need this it will save me a lot of time! |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|