![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| PHP PHP for some can be one of the hardest website programming codes, so do you need help on your PHP script, if it is php4, php5 or lower this is the place for you for any PHP help. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| The code inside class'es function is: var_dump($id); $this->db->SQL_delete($id); die('poqw'); $this->db is a abstract db layer (extends PHPLib). db is declared and works fine. Problem is that argument given do SQL_delete is always = '', although before it prints out '8'. Theo body of this function is: function SQL_delete($id = '@@@') { var_dump($id);die('jg8590'); Of course script dies here. But it prints '' instead of '8'. Any ideas? Paul | |||
|
| Advertisements |
| | #2 | ||
| local in both cases pawel > What's the scope of variable $id? Declared locally, passed parameter? > > ie maybe you need to declare global $id at the start of the method, > or should it be "$this->id"? > > Mike > > "Paweł" <koral21@poczta.onet.pl> wrote in message > news:bef39f$l7j$1@news.onet.pl... > > The code inside class'es function is: > > > > var_dump($id); > > $this->db->SQL_delete($id); > > die('poqw'); > > > > $this->db is a abstract db layer (extends PHPLib). db is declared and > works > > fine. Problem is that argument given do SQL_delete is always = '', > although > > before it prints out '8'. Theo body of this function is: > > > > function SQL_delete($id = '@@@') { > > var_dump($id);die('jg8590'); > > > > Of course script dies here. But it prints '' instead of '8'. Any ideas? > > > > Paul > > > > > > | |||
|
| | #3 | ||
| Can you post the code for the entire function? "Paweł" <koral21@poczta.onet.pl> wrote in message news:bei3no$j76$1@news.onet.pl... > local in both cases > pawel > > > What's the scope of variable $id? Declared locally, passed parameter? > > > > ie maybe you need to declare global $id at the start of the method, > > or should it be "$this->id"? > > > > Mike > > > > "Paweł" <koral21@poczta.onet.pl> wrote in message > > news:bef39f$l7j$1@news.onet.pl... > > > The code inside class'es function is: > > > > > > var_dump($id); > > > $this->db->SQL_delete($id); > > > die('poqw'); > > > > > > $this->db is a abstract db layer (extends PHPLib). db is declared and > > works > > > fine. Problem is that argument given do SQL_delete is always = '', > > although > > > before it prints out '8'. Theo body of this function is: > > > > > > function SQL_delete($id = '@@@') { > > > var_dump($id);die('jg8590'); > > > > > > Of course script dies here. But it prints '' instead of '8'. Any ideas? > > > > > > Paul > > > > > > > > > > > > | |||
|
| | #4 | ||
| function wykonaj_usun($komunikat = '') { if ($komunikat == '') $this->msg = sprintf($this->komunikaty['usuniety'], $this->s('par', $this->komunikaty['pole'])); else $this->msg = $komunikat; $id = $this->parametry[$this->db->id_field]['wartosc']; var_dump($id); $this->db->SQL_delete($id); die('poqw'); $this->wykonaj_wyjdz(); } function SQL_delete($id = '@@@') { var_dump($id);die('jg8590'); if($id == '') $id = strtoupper($this->fields[$this->id_field]); return $this->ask("delete from $this->table where ". $this->id_field."='$id'"); // and ".$this->combine_conditions(); } > Can you post the code for the entire function? > > local in both cases > > > > > What's the scope of variable $id? Declared locally, passed parameter? > > > > > > ie maybe you need to declare global $id at the start of the method, > > > or should it be "$this->id"? > > > > > > > The code inside class'es function is: > > > > > > > > var_dump($id); > > > > $this->db->SQL_delete($id); > > > > die('poqw'); > > > > > > > > $this->db is a abstract db layer (extends PHPLib). db is declared and > > > works > > > > fine. Problem is that argument given do SQL_delete is always = '', > > > although > > > > before it prints out '8'. Theo body of this function is: > > > > > > > > function SQL_delete($id = '@@@') { > > > > var_dump($id);die('jg8590'); > > > > > > > > Of course script dies here. But it prints '' instead of '8'. Any > ideas? > > > > | |||
|
| | #5 | ||
| I presume $this->parametry returns an integer. I'm always uncomfortable with forcing type changes, so what if you change the definition (for test purposes) of SQL_delete from: function SQL_delete($id = '@@@') { to: function SQL_delete($id) { "Paweł" <koral21@poczta.onet.pl> wrote in message news:beja7h$nt2$1@news.onet.pl... > function wykonaj_usun($komunikat = '') { > if ($komunikat == '') $this->msg = > sprintf($this->komunikaty['usuniety'], $this->s('par', > $this->komunikaty['pole'])); > else $this->msg = $komunikat; > $id = $this->parametry[$this->db->id_field]['wartosc']; > var_dump($id); > $this->db->SQL_delete($id); > die('poqw'); > $this->wykonaj_wyjdz(); > } > > function SQL_delete($id = '@@@') { > var_dump($id);die('jg8590'); > if($id == '') $id = strtoupper($this->fields[$this->id_field]); > return $this->ask("delete from $this->table where ". > $this->id_field."='$id'"); // and ".$this->combine_conditions(); > } > > > > Can you post the code for the entire function? > > > > local in both cases > > > > > > > What's the scope of variable $id? Declared locally, passed parameter? > > > > > > > > ie maybe you need to declare global $id at the start of the method, > > > > or should it be "$this->id"? > > > > > > > > > The code inside class'es function is: > > > > > > > > > > var_dump($id); > > > > > $this->db->SQL_delete($id); > > > > > die('poqw'); > > > > > > > > > > $this->db is a abstract db layer (extends PHPLib). db is declared > and > > > > works > > > > > fine. Problem is that argument given do SQL_delete is always = '', > > > > although > > > > > before it prints out '8'. Theo body of this function is: > > > > > > > > > > function SQL_delete($id = '@@@') { > > > > > var_dump($id);die('jg8590'); > > > > > > > > > > Of course script dies here. But it prints '' instead of '8'. Any > > ideas? > > > > > > > | |||
|
| | #6 | ||
| I presume $this->parametry returns an integer. I'm always uncomfortable with forcing type changes, so what if you change the definition (for test purposes) of SQL_delete from: function SQL_delete($id = '@@@') { to: function SQL_delete($id) { "Paweł" <koral21@poczta.onet.pl> wrote in message news:beja7h$nt2$1@news.onet.pl... > function wykonaj_usun($komunikat = '') { > if ($komunikat == '') $this->msg = > sprintf($this->komunikaty['usuniety'], $this->s('par', > $this->komunikaty['pole'])); > else $this->msg = $komunikat; > $id = $this->parametry[$this->db->id_field]['wartosc']; > var_dump($id); > $this->db->SQL_delete($id); > die('poqw'); > $this->wykonaj_wyjdz(); > } > > function SQL_delete($id = '@@@') { > var_dump($id);die('jg8590'); > if($id == '') $id = strtoupper($this->fields[$this->id_field]); > return $this->ask("delete from $this->table where ". > $this->id_field."='$id'"); // and ".$this->combine_conditions(); > } > > > > Can you post the code for the entire function? > > > > local in both cases > > > > > > > What's the scope of variable $id? Declared locally, passed parameter? > > > > > > > > ie maybe you need to declare global $id at the start of the method, > > > > or should it be "$this->id"? > > > > > > > > > The code inside class'es function is: > > > > > > > > > > var_dump($id); > > > > > $this->db->SQL_delete($id); > > > > > die('poqw'); > > > > > > > > > > $this->db is a abstract db layer (extends PHPLib). db is declared > and > > > > works > > > > > fine. Problem is that argument given do SQL_delete is always = '', > > > > although > > > > > before it prints out '8'. Theo body of this function is: > > > > > > > > > > function SQL_delete($id = '@@@') { > > > > > var_dump($id);die('jg8590'); > > > > > > > > > > Of course script dies here. But it prints '' instead of '8'. Any > > ideas? > > > > > > > | |||
|
| Featured Websites | ||||
|
![]() |
| Tags: but, simply, thing, work |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| This is simply amazing...... | Julius | Console Subjects | 3 | 06-26-2007 10:41 AM |
| Simply THE best affiliate handbook | Dermo | Affiliate Programs | 0 | 06-12-2007 8:22 PM |
| Forza 2 - Simply stunning to look at but fooking hard. | scoopex | Console Subjects | 4 | 06-11-2007 12:03 PM |
| Calling all Cars is simply brilliant! | boodybandit | Computer Consoles | 3 | 05-30-2007 9:20 PM |
| Simply make more money | Marc | Building An Internet Business | 0 | 05-29-2007 2:26 AM |
| Featured Websites | ||||
|