Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Kinda refresh variable

Status
Not open for further replies.

jgd12345

Technical User
Joined
Apr 22, 2003
Messages
124
Location
GB
Hey, I have got a variable which includes other variables which have not been set, I then need it to refresh that variable once the others have been set. ie

$tableheader = &quot;<table width=\&quot;$tablewidth\&quot;>&quot;;

$tablewidth = &quot;75%&quot;;

Refresh $tableheader?????????

Hope you can help. Thanx
 
do

$tableheader = &quot;<table width=\&quot;$tablewidth\&quot;>&quot;;

again?
 
I can't because the value is selected from a table and can be different for different themes.
 
$query = $db->query(&quot;SELECT * FROM $table_themes WHERE name='$theme'&quot;);

foreach($db->fetch_array($query) as $key => $val) {
if($key != &quot;name&quot;) {
$$key = $val;
}
}

Here's abit more info. Here's how the variables are generated. ie say the $table_themes table has the following structure:

- name
- tablewidth
- tableheader
 
PHP is not a spreadsheet. It won't automagically update variables simply because you've changed another one somewhere.

You're going to have to perform the substitution at the time appropriate for your code.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top