- Forums
- Snippets
- Getting Array Elements Values With While Loop Show Display
This Page Contains information about Getting Array Elements Values With While Loop Show Display By wallpaperama in category Snippets with 1 Replies. [1376], Last Updated: Sat May 18, 2024
wallpaperama
Sat Feb 23, 2008
1 Comments
1340 Visits
How To Display Array Elements with FOR Loop:
today i will show you how you can get the elements of an array and declare them into an string so you can use them later on in your script
for example, i have this database table where i have all my configuration for the site, so to get the elements or values of each configuration field i can use the while loop
$board_config = array();
$sql = "SELECT * FROM ".$db_prefix."config";
$result = mysql_query($sql ,$db);
while ( $row = $myrow = mysql_fetch_array($result) )
{
$board_config[$row['config_name']] = $row['config_value'];
}
i would like to request to all please write code that retrieve data and image from datbase of a field to be randomly in webpage.
thank you in advance.
kind regard,
chantha
https://www.wallpaperama.com/forums/getting-array-elements-values-with-while-loop-show-display-t5793.html