Okay,
So I want an array to get userinformation by the username that is provided. But in the other tables, it only has a ID field to link with...
$sql = "mos_users.id as userid, block, username, email, lastvisitDate, firstname, lastname, avatar, cb_age, userip FROM mos_users, mos_comprofiler, mos_comprofiler_plug_iplog WHERE mos_users.username = '". $user."' AND mos_comprofiler.user_id = (SELECT id FROM mos_users WHERE username = '".$user."') AND mos_comprofiler_plug_iplog.userid = (SELECT id FROM mos_users WHERE username = '".$user."')";
Below is the query that works, if I give in the ID , I get all the information I want
$sql = "SELECT mos_users.id as userid, block, username, email, lastvisitDate, firstname, lastname, avatar, cb_age, userip FROM mos_users, mos_comprofiler, mos_comprofiler_plug_iplog WHERE mos_users.id = ". $id . " AND mos_comprofiler.user_id = " . $id . " AND mos_comprofiler_plug_iplog.userid = " . $id;
Can someone tell me what I'm doing wrong? I've been at this for several hours now...