|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Select query probelm in mdb2 package
i have table in database(mysql) is: user
and i have the data in user table when the page is open in my application the data in user table is like bellow abc | xyz |123| apple and in the application i have 3 buttons those are update , edit and cancel buttons when i click edit button it will fetch the data from data base(Mysql) and display in the form it's working fine but if i updated with new data it's updating sucessfully in database(ex: iam updating old data(Apple in user table) with Mango(new data)). this also working fine in appliction the problem is if i click EDIT button.now it's feteching old data(i.e the data what is available when i opened application EX:apple(old data ie before update stament data)) pls help regarding this problem |
|
#2
|
|||
|
|||
|
Maybe you want to show us (the relevant parts of) your code? The described problem doesn't sound like a bug in MDB2.
|
|
#3
|
|||
|
|||
|
Quote:
$types = array("text"); $statement = $this->db->prepare("SELECT first_name FROM users WHERE user_id = ?", $types, MDB2_PREPARE_RESULT); $data = array('37'); $resultset = $statement->execute($data); if(PEAR::isError($resultset)) { die('failed... ' . $resultset->getMessage()); } $statement->Free(); while($row = $resultset->fetchRow(MDB2_FETCHMODE_ASSOC)) { print "Found : " . $row['first_name'] . "\n"; } or else{ //$this->db->setFetchMode(MDB2_FETCHMODE_ASSOC); //$this->db =& initialize_database($dsn,true); $result = $this->db->queryRow("SELECT user_id,first_name,last_name,email_address,active, is_admin,is_project_manager FROM users WHERE user_id='$userId'"); $kk="SELECT user_id,first_name,last_name FROM users WHERE user_id=$userId"; $data = $this->db->extended->getRow($kk, array('integer', 'text', 'text')); print('extendtedd-->'.$data['first_name']); } $result1 = $this->db->query("SELECT user_id,first_name,last_name,title,email_address,a ctive,is_sibson, is_admin,is_project_manager FROM users WHERE active='Y'"); if($this->db->isError($result1) || count($result1)<1){ return false;} $row1 = $result1->fetchRow(); $this->db->setFetchMode(DB_FETCHMODE_ORDERED); print('row1->'.$row1[1][2].'<--'); if($this->db->isError($result)){ return false;} //$row = $result->fetchRow(); //$this->db->setFetchMode(DB_FETCHMODE_ORDERED); //if(count($row)<1) return false; print('first Name-->'.$result['first_name']); |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PEAR Packages > Select query probelm in mdb2 package |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|