Jump to content

data field from db


Recommended Posts

$sql = 'SELECT * FROM '._DB_PREFIX_.'customer WHERE id_customer = $customer';

if ($row = Db::getInstance()->getRow($sql))

 

$genderid=$row['id_gender']; -> ok

$name=$row['firstname']; -> ok

$lastname=$row['lastname']; -> ok

 

$birthday=$row['birthday']; -> NOT WORKING o_O

 

i cannot extract data field from db...

 

where is my mistake? anyone could help me pleaze?

 

Thank you

zio

Edited by ziostanko (see edit history)
Link to comment
Share on other sites

$sql = 'SELECT * FROM '._DB_PREFIX_.'customer WHERE id_customer = $customer';

if ($row = Db::getInstance()->getRow($sql))

 

$genderid=$row['id_gender']; -> ok

$name=$row['firstname']; -> ok

$lastname=$row['lastname']; -> ok

 

$birthday=$row['birthday']; -> NOT WORKING o_O

 

i cannot extract data field from db...

 

where is my mistake? anyone could help me pleaze?

 

Thank you

zio

 

I know this is a stupid question ... but you are you sure that this row is not empty in database?

Edited by vekia (see edit history)
Link to comment
Share on other sites

yes i'm sure :P

expacially the birthday field has data in it....

 

i use this query to extract data on ActionCustomerAccountAdd hook beacuse context birthday ($this->context->customer->birthday) variable has a different date format:

 

context: 1978-3-12

database: 1978-03-12

 

i need database date field format :P

Edited by ziostanko (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...