Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,207,565 members, 7,999,462 topics. Date: Monday, 11 November 2024 at 08:06 AM |
Nairaland Forum / Science/Technology / Programming / Help With PHP Array, Result Is Skipping A Row (925 Views)
Complete Array Of Countries And Nigerian States [open Source] / Converting Picture To Byte Array(blob) And Back To Picture (2) (3) (4)
(1) (Reply)
Help With PHP Array, Result Is Skipping A Row by mj(m): 7:55am On Sep 26, 2012 |
im trying to select the amount column in the database table but i notice that it is skipping a row in the table, this is my code; Thanks. $Amount_results = mysql_query("select `Amount` from transaction" or die("Can not select amount :" . mysql_error()); $result_list = array(); while($row = mysql_fetch_array($Amount_results)) { $result_list[] = $row['Amount']; } foreach ($result_list as $amount) { echo $amount ."<br />"; } |
Re: Help With PHP Array, Result Is Skipping A Row by Nobody: 6:01pm On Sep 26, 2012 |
you seem to be making this more difficult than it should here is what usually do i have a file database.php which i include using require_once $hostname_conn = "localhost"; then in all your codes, you will be able to code less for the above, we just have something like this
i always like fetching the resource as an associative array, you are able to use the name to call it instead of the index which can change when you modify your database structure. 1 Like |
Re: Help With PHP Array, Result Is Skipping A Row by mj(m): 8:49pm On Sep 26, 2012 |
@ webdezzi, thanks... |
(1) (Reply)
Join The Ongoing Mobile Application Development Project / Looking Plc Programming? In Just A Week / Offline Computer Based Exams For Students
(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. 7 |