I have following.
.
.
.
$userid = 2
.
$query = "select username from users where userid = ".$userid.";";
.
$username = $line['uid'];
$data="Some Data Here";
.
$query = "insert into logger (username, data) valuse ($username, $data);";
.
I would like to not have 2 database calls.
Im sure there is a way to "join" the 2. I want to store the actual username in the logger table and not the UID#, I have not had much luck.
Probabally something really easy im missing.
Something like this:
insert into logging
('type','who','data','ipaddress')
values
("testing", (select username from users where id = 2;), "data here","1.1.1.1");
Thanks...