note 73806 rejected from ref.classobj by dmytton

From: Date: Sun, 11 Mar 2007 09:03:37 +0000
Subject: note 73806 rejected from ref.classobj by dmytton
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-124318@lists.php.net to get a copy of this message
Note Submitter: playvalles at gmail dot com ---- Hi guys, I'm using a class with a function like this: <?php function setStatus($set, $condition) { $m = 0; $q = "UPDATE archivos SET archivos.estado = '".$set."' WHERE archivos.id = '".$this->id."'"; if(isset($condition)) { $q .= " AND archivos.estado = '".$condition."'"; $m++; } $q .= " LIMIT 1"; $query = mysql_query($q, $this->connexio); $queryB = mysql_query('SELECT * FROM archivos WHERE archivos.id = '.$this->id.' LIMIT 1', $this->connexio); $dataB = mysql_fetch_assoc($queryB); if($dataB['estado'] == $set) { $this->url = $set; return true; } else { if($m > 0) { return true; } else { return false; } } } ?> and what I want to know is... how can I do to declare that the second argument ($condition) it's optional, because I'm always seeing that: Warning: Missing argument 2 for files::setStatus() in /home/d191470/public_html/plataforma/class/files.php on line 175

« previous php.notes (#124318) next »