[PHP] How to find out which function caused an error

2001-08-15 Thread Justin Finkelstein

Hi kids

I have a function in one of my includes: db.inc.php::getQuery which does
most of my mySQL calling for me.

However, when the mySQL call fails, I get a nice error which is useful
except one thing. It doesn't tell me which function called it.

Does anyone know how to find to do the equivalent of:

function myFunc()
{
echo myFunc was called by the function $calling_function;
}

Any ideas?

j.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to find out which function caused an error

2001-08-15 Thread Tyler Longren

Can you post the error so we can have a look at it?  If it didn't provide
a function, it's probably a parse error (missing semi-colon, missing
quote).

Tyler Longren
Captain Jack Communications
[EMAIL PROTECTED]
www.captainjack.com



On Wed, 15 Aug 2001 18:43:49 +0100
Justin Finkelstein [EMAIL PROTECTED] wrote:

 Hi kids
 
 I have a function in one of my includes: db.inc.php::getQuery which does
 most of my mySQL calling for me.
 
 However, when the mySQL call fails, I get a nice error which is useful
 except one thing. It doesn't tell me which function called it.
 
 Does anyone know how to find to do the equivalent of:
 
 function myFunc()
 {
 echo myFunc was called by the function $calling_function;
 }
 
 Any ideas?
 
 j.
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to find out which function caused an error

2001-08-15 Thread Justin Finkelstein

The error I get is filtered by the getQuery function. It spits out:

Unable to execute query in getQuery: insert into textblocks (id, language,
textitem) values (max(id)+1, 'en', '')
Error: Unknown column 'textitem' in 'field list'

The code for the function (for reference) is:

 function getQuery($sqlquery)
  // executes an arbitrary SQL query and returns the result
  {
   global $connID;

   // check for connection state
   if (!$connID) getConnection();

   // execute it
   $result = mysql_query($sqlquery, $connID) or die(Unable to execute query
in getQuery: $sqlquery\nbrError: .mysql_error());

   return $result;
  }

Any suggestions?

j.


- Original Message -
From: Tyler Longren [EMAIL PROTECTED]
To: Justin Finkelstein [EMAIL PROTECTED]; php-general
[EMAIL PROTECTED]
Sent: Wednesday, August 15, 2001 6:46 PM
Subject: Re: [PHP] How to find out which function caused an error


Can you post the error so we can have a look at it?  If it didn't provide
a function, it's probably a parse error (missing semi-colon, missing
quote).

Tyler Longren
Captain Jack Communications
[EMAIL PROTECTED]
www.captainjack.com



On Wed, 15 Aug 2001 18:43:49 +0100
Justin Finkelstein [EMAIL PROTECTED] wrote:

 Hi kids

 I have a function in one of my includes: db.inc.php::getQuery which does
 most of my mySQL calling for me.

 However, when the mySQL call fails, I get a nice error which is useful
 except one thing. It doesn't tell me which function called it.

 Does anyone know how to find to do the equivalent of:

 function myFunc()
 {
 echo myFunc was called by the function $calling_function;
 }

 Any ideas?

 j.




 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] How to find out which function caused an error

2001-08-15 Thread Jason Murray

 Unable to execute query in getQuery: insert into textblocks 
 (id, language,
 textitem) values (max(id)+1, 'en', '')
 Error: Unknown column 'textitem' in 'field list'

I daresay that your table textblocks doesn't have a column
called textitem.

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]





Re: [PHP] How to find out which function caused an error

2001-08-15 Thread Justin Finkelstein

Yes, that I know.

That wasn't the point though. What I wanted was to find out which function
called getQuery.

j.

- Original Message -
From: Jason Murray [EMAIL PROTECTED]
To: 'Justin Finkelstein' [EMAIL PROTECTED]; Tyler Longren
[EMAIL PROTECTED]; php-general [EMAIL PROTECTED]
Sent: Thursday, August 16, 2001 3:05 AM
Subject: RE: [PHP] How to find out which function caused an error


 Unable to execute query in getQuery: insert into textblocks
 (id, language,
 textitem) values (max(id)+1, 'en', '')
 Error: Unknown column 'textitem' in 'field list'

I daresay that your table textblocks doesn't have a column
called textitem.

Jason



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]