Help With PHP Array, Result Is Skipping A Row - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › Help With PHP Array, Result Is Skipping A Row (984 Views)
1 Reply
| Help With PHP Array, Result Is Skipping A Row by mj(op): 7:55am On Sep 26, 2012*. Modified: 9:36am 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 then in all your codes, you will be able to code less$hostname_conn = "localhost"; 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. |
| Re: Help With PHP Array, Result Is Skipping A Row by mj(op): 8:49pm On Sep 26, 2012 |
@ webdezzi, thanks... |
Complete Array Of Countries And Nigerian States [open Source] • Converting Picture To Byte Array(blob) And Back To Picture • 2 • 3 • 4
Just Beginning To Learn Programming • . • Suggestions To Make Bible Topics App Better
or die("Can not select amount :" . mysql_error());