私はクラスファイルを持っています。それを「もの」と呼びましょう
Stuff.class
中にクラスがあります
class Stuff {
そしてそこにパブリック静的関数があります
public static function morestuff() {
}
内部では、クエリのために別の関数を呼び出す必要があります
$q="Select from contacts where id =". $this->$db->escapeVal($ID)".";
しかし、エラーが発生します。
$q="Select from contacts where id =". escapeVal($ID)".";
戻り値
Call to undefined function escapeVal()
$q="Select from contacts where id =". $db->escapeVal($ID)".";
戻り値
Call to a member function escapeVal() on a non-object
$q="Select from contacts where id =". $this->$db->escapeVal($ID)".";
戻り値
Using $this when not in object context
それで、私は何を入れますか?
編集:
同じファイル内の同様の関数には、次のコードがあります
'id' = '" . $this->db->escapeVal($this->_Id) . "'
ただし、mysql クエリでこのコードを使用しようとすると、次のエラーが発生します。
Using $this when not in object context