So for example, I have a class called 'Clients' and a function within it called 'add'. I want to submit a MySQL query using the add function within the class. A code example
Code: Select all
class Clients {
function add() {
mysql_query("insert into table values('....')");
}
}Code: Select all
class Clients {
function add() {
mysql_query("insert into table values('$_POST[a]','$_POST[b]')");
}
}Code: Select all
class Clients {
function add($a, $b) {
mysql_query("insert into table values('$a','$b')");
}
}Code: Select all
class Clients {
var $a = $_POST[a];
var $b = $_POST[b];
function add() {
mysql_query("insert into table values('$this->a',"$this-b')");
}
}