Magento Forum

   
checking for a db field
 
prionko
Jr. Member
 
Total Posts:  21
Joined:  2009-03-04
 

Hi,

Is there any way of determining whether a column exists in any db table ( say customer_entity table) of magento ?

Thanks !!

 
Magento Community Magento Community
Magento Community
Magento Community
 
brendanb
Mentor
 
Total Posts:  1077
Joined:  2008-07-16
London, United Kingdom
 

hi,

you could check out the INFORMATION_SCHEMA.COLUMNS table for details on all columns in the db

here is a quick exmaple:

SELECT COLUMN_NAMECOLUMN_COMMENT FROM(INFORMATION_SCHEMA.COLUMNSWHERE TABLE_SCHEMA 'your magento database name here'

hth
brendan

 
Magento Community Magento Community
Magento Community
Magento Community
 
prionko
Jr. Member
 
Total Posts:  21
Joined:  2009-03-04
 

Thanks Brendan for the reply,

I should have framed my question in a better way.

Im using the customer.update api for updating my fields and im using xml-rpc based webservices.

Here is the call :

$update = array( 'firstname1111'=>'changed occupation test');
    
//'firstname'=>'Changed Firstname1 ',
                    //'lastname'=> 'Changed lastname1 ',
                    
                    //'taxvat'=>'11.10');
    
$newCustomerId=1;
    
    
$client->call('call',array($session,'customer.update', array($newCustomerId$update)));

As you can see from the code, the field ‘firstname111’ doesnt exist in the db, and i want to throw up an exception for it.

How can i do it ??

 
Magento Community Magento Community
Magento Community
Magento Community
 
brendanb
Mentor
 
Total Posts:  1077
Joined:  2008-07-16
London, United Kingdom
 

ah oh,

sorry cant really help.
The API is something im going to tackle in a little while. There have been some issues which have stopped me from moving forward..

id suggest you could try posting a comment in this group

http://www.magentocommerce.com/group/blog/action/viewpost/167/group/139/

or try the dataflow forum. There isnt a dedicated API forum, which is kinda odd

brendan

 
Magento Community Magento Community
Magento Community
Magento Community
 
prionko
Jr. Member
 
Total Posts:  21
Joined:  2009-03-04
 

Ok ...just let me know if you stumble upon anything

Thanks !!

 
Magento Community Magento Community
Magento Community
Magento Community
 
prionko
Jr. Member
 
Total Posts:  21
Joined:  2009-03-04
 

anybody who can provide me some solution to this problem ??

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top