Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,194,668 members, 7,955,420 topics. Date: Sunday, 22 September 2024 at 04:58 AM |
Nairaland Forum / Science/Technology / Webmasters / Mysql Query Returned Duplicate Records. Help Me Plz (401 Views)
What Skills Can My Brother Learn? Advise Me Plz / Help, My Artisteer-joomla Generated Theme Has a Duplicate Menus / Howto Query Webpayinterswitch Transaction Status Using Wordpress(wp_remote_get) (2) (3) (4)
(1) (Reply)
Mysql Query Returned Duplicate Records. Help Me Plz by Alichigozie: 2:23pm On Jul 19, 2015 |
I want to select record from three tables that has a unique field(acc_no). Mysql query i used successfully selected the records but duplicates the result when outputing it. I'm using php script. Plz can someone help me with a code to eliminate this duplicative behaviour. Thanks. The code i used was : <?php $val=$_POST['textfield']; $myquery=mysql_select_query("SELECT* FROM deposit, withdrawal, charges WHERE deposit.acc_no=withdrawal.acc _no AND withdrawal.acc_no=charges.acc_no AND deposit.acc_no='$val' " ) ; while($r2=mysql_fetch_array($myquery)){ $a1=$r2['depositor']; echo $a1; $a2=$r2['depositAmt']; echo $a2; $a3=$r2['withdrawee']; echo $a3; $a4=$r2['withdrawalAmt']; echo $a4; $a5=$r2['chargeDescription']; echo $a5; $a6=$r2['chargeAmt']; echo $a6; } ?> |
(1) (Reply)
Supremegist.com Out For Sell / How I Made Over 5000visitors To My Blog / more4rm9ja
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 20 |