Computer Webmaster Gaming Console Graphics Forum

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.

MK PitStop Main Earn $25 Earn Money Posting Extras Members Blogs Image Hosting User Pages
Go Back   Computer Webmaster Gaming Console Graphics Forum > Webmaster Forum > Website Coding > PHP
Register FAQ/Rules Become A V.I.P. Member Search Today's Posts Mark Forums Read

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.

Google
Reply
 
LinkBack Thread Tools Display Modes
Old 07-01-2007, 3:32 PM   #1
Paweł
 
Paweł's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default simply thing but don't work :(

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


 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Advertisements
Old 07-01-2007, 3:33 PM   #2
Paweł
 
Paweł's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default What's the scope of variable $id?

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
> >
> >

>
>



 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 07-01-2007, 3:33 PM   #3
2metre
 
2metre's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default What's the scope of variable $id?

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
> > >
> > >

> >
> >

>
>



 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 07-01-2007, 3:33 PM   #4
Paweł
 
Paweł's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default What's the scope of variable $id?

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?
> > > >



 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 07-01-2007, 3:33 PM   #5
2metre
 
2metre's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default What's the scope of variable $id?

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?
> > > > >

>
>



 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 07-01-2007, 3:34 PM   #6
2metre
 
2metre's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default What's the scope of variable $id?

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?
> > > > >

>
>



 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Featured Websites
Free Space
Free Space
Free Space Free Space
Reply
Tags: , , ,




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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




All times are GMT +1. The time now is 11:27 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
Cheap Computers
MK PitStop Copyright 2005 - 2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98