View Single Post
Old 01-04-2008, 09:41 PM   #10 (permalink)
Alan @ CIT
Member of the Month
The Frequenter
Member of the Month Top Contributor 
 
Alan @ CIT's Avatar
 
Join Date: Apr 2005
Location: South UK
Posts: 483
Thanks: 51
Alan @ CIT is on a distinguished road
Default

Wow, that's insane Salathe :D Followed the code about halfway through then I'm fairly certain I blacked out :D

Another way to do it (if in doubt, use a database!):

PHP Code:
<?php

$a 
1;
$b 2;

$db sqlite_open('talkphp.db');
sqlite_query($db'CREATE TABLE talkphp (var varchar(2), val int)');
sqlite_query($db"INSERT INTO talkphp (var, val) VALUES ('a', "$a ")");
sqlite_query($db"INSERT INTO talkphp (var, val) VALUES ('b', "$b ")");
$vars_r sqlite_query($db'select * from talkphp');
$vars_a sqlite_fetch_all($vars_r);
$a $vars_a[1]['val'];
$b $vars_a[0]['val'];

echo 
$a;
echo 
$b;
Alan.
Send a message via MSN to Alan @ CIT
Alan @ CIT is offline  
Reply With Quote