ok, so i a database with id, name, value. i want to take name and set it equal to the value of it. then i want to take value and set that equal to its value. then i wanna set "name" = "value" so my database will automatically create the config file for my websites. i just started using mysql last night and im really stumped. heres what i have.
<?php
$db = mysql_connect("localhost", "database", "password");
mysql_select_db("database", $db);
$result=mysql_query("SELECT * FROM config", $db);
while($myrow = mysql_fetch_array($result))
{
$myrow["name"] = $myrow["value"];
}
?>
dynamic variables with php loop from mysql database
Moderator: General Moderators
-
learning_php_mysql
- Forum Commoner
- Posts: 27
- Joined: Sun Aug 04, 2002 12:58 pm
- Location: WA
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Naughty cross-poster, please go here:
http://www.devnetwork.net/forums/viewtopic.php?t=2033
to continue this thread.
Mac
http://www.devnetwork.net/forums/viewtopic.php?t=2033
to continue this thread.
Mac