nothing being echoed

see code below, nothing is being echoed. as soon as i change username = “$username” to username = “p0stpwned” something is being returned.

how can i fix this?

$username = $_POST[‘user’];
mysql_connect(‘localhost’, ‘root’, ‘’);
$sql = mysql_query(‘SELECT * from users WHERE username = “$username”’);
while($row = mysql_fetch_assoc($sql)){
foreach ($splittedstring as $key => $value) {
$msgs = mysql_query(‘SELECT * from msgs WHERE username = “$value”’);
while($msg = mysql_fetch_assoc($msgs)){
echo $msg[‘message’] . "
by " . $msg[‘username’];

cheers :slight_smile:

Hi there,

Has the form that’s being posted definitely got an element with a name of ‘user’ (is $username definitely set). Also try changing it to:

WHERE username = \''.$username.'\'');
Sponsor our Newsletter | Privacy Policy | Terms of Service