List:General Discussion« Previous MessageNext Message »
From:Sven Bentlage Date:May 15 2002 3:18am
Subject:mixed up variables
View as plain text  
Hi!
I'm using the code below to fetch data from mysql, but when I print iit 
out, several variables are always mixed up.
For example $u_course has the value of membership_paid, membership has 
the values of pcont.

Can anybody help me figure out how to correct that?


Thank you for your help.

sven
code:
my $sth = $dbh->prepare(
	"select *
	from memberscopy
	where name = '$f_name' and surname = '$f_surname' "
						);


	$sth->execute;

	#combine perl variables with data

	      $sth->bind_col(1, \$u_id );
     	  $sth->bind_col(2, \$u_surname);
           $sth->bind_col(3, \$u_name);
           $sth->bind_col(4, \$u_rank);
           $sth->bind_col(5, \$u_cname);
           $sth->bind_col(6, \$u_caddress);
           $sth->bind_col(7, \$u_ctel);
           $sth->bind_col(8, \$u_cfax);
           $sth->bind_col(9, \$u_cmobile);
           $sth->bind_col(10, \$u_cemail);
           $sth->bind_col(11, \$u_curl);
           $sth->bind_col(12, \$u_btype);
           $sth->bind_col(13, \$u_hq);
           $sth->bind_col(14, \$u_quali);
           $sth->bind_col(15, \$u_experi);
           $sth->bind_col(17, \$u_inhouse);
           $sth->bind_col(18, \$u_resid);
           $sth->bind_col(19, \$u_ptel);
           $sth->bind_col(20, \$u_pfax);
           $sth->bind_col(21, \$u_pmobile);
           $sth->bind_col(22, \$u_pemail);
           $sth->bind_col(23, \$u_birthday);
           $sth->bind_col(24, \$u_marital);
           $sth->bind_col(25, \$u_spouse);
           $sth->bind_col(26, \$u_children_number);
           $sth->bind_col(27, \$u_children_names);
           $sth->bind_col(28, \$u_hobbies);
           $sth->bind_col(29, \$u_membership);
           $sth->bind_col(30, \$u_pcont);
           $sth->bind_col(31, \$u_permtel);
           $sth->bind_col(32, \$u_permfax);
           $sth->bind_col(33, \$u_nation);
           $sth->bind_col(34, \$u_course);
           $sth->bind_col(35, \$u_loginid);
           $sth->bind_col(36, \$u_japan_row);
           $sth->bind_col(37, \$u_password);
           $sth->bind_col(38, \$u_lastup);
           $sth->bind_col(39, \$u_ETPA_membership_paid);
           $sth->bind_col(40, \$u_ETPA_membership_expires);

table structure:



CREATE TABLE memberscopy (
   id int(6) default NULL,
   surname text,
   name varchar(50) default NULL,
   rank text,
   cname text,
   caddress text,
   ctel text,
   cfax text,
   cmobile text,
   cemail text,
   curl text,
   btype text,
   hq text,
   quali text,
   experi text,
   inhouse text,
   resid text,
   ptel text,
   pfax text,
   pmobile text,
   pemail text,
   birthday text,
   marital text,
   spouse varchar(150) default NULL,
   children_number varchar(150) default NULL,
   children_names varchar(150) default NULL,
   hobbies text,
   membership text,
   pcont text,
   permtel text,
   permfax text,
   course int(3) default NULL,
   nation varchar(40) default NULL,
   lastup year(4) default NULL,
   loginid text,
   password text,
   japan_row set('jjj','rrr') default NULL,
   ETPA_membership_paid date default NULL,
   ETPA_membership_expires date default NULL,
   face blob,
   KEY id (id),
   FULLTEXT KEY resid (resid)
) TYPE=MyISAM;

Thread
mixed up variablesSven Bentlage15 May
  • Re: mixed up variables || solution foundSven Bentlage15 May
    • Re: mixed up variables || solution foundColin Faber15 May
    • Re: mysql errorColin Faber15 May
Re: mixed up variables || solution foundMark15 May