HI all I'm trying to do the following ----------------------------------------------------------------------------------------------------------------------------------------------- # want to select (just preparing) every thing from the table PERSON where i don't know the deptID yet. $per = $dbh->prepare("SELECT * FROM person WHERE deptID = ?"); # selecting deptID from the table ACCOUNT, say with some condition $acc = $dbh->prepare("SELECT deptID FROM account WHERE ....; $acc->execute() or die "Can't execute the SQL statment: $DBI::errstr\n";
while ( @accRow = $acc->fetchrow_array ) { # For each deptID I get from the ACCOUNT table, I want all the info from the PERSON table $per->execute($accRow[0] ) or die "Can't execute the SQL statment: $DBI::errstr\n"; .................. ----------------------------------------------------------------------------------------------------------------------------------------------------- When I execute above coding I got error saying DBD::mysql::st execute failed: Column: 'deptID' in where clause is ambiguous at ./mkPasswdFile line 76, <STDIN> chunk 2. I'm following the example in http://www.perl.com/pub/a/1999/10/DBI.html The line 76 : $per->execute($accRow[0] ) I also tried quote($accRow[0]), any idea??? Thank you for you help Vinita --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php