Jump to content


This topic is now archived and is closed to further replies.


Whats wrong with this code?

Recommended Posts

What is wrong with this code:


NOTE: I use phpbb. I am having it link to the phpbb files. If someone could remake my idea without the use of php I would greatly appritate it.




<title>DFA :: Stocks :: Check Value</title>




define(\'IN_PHPBB\', true); 

$phpbb_root_path = \'./forum/\'; 

include($phpbb_root_path . \'extension.inc\'); 

include($phpbb_root_path . \'common.\'.$phpEx); 

if ($mode = "username")


$sql = "SELECT username AS username WHERE username = \'$username\' FROM ".USERS_TABLE."";

if ( !($result = $db->sql_query($sql)) ) 


   message_die(GENERAL_ERROR, \'Could not check username.\', \'\', __LINE__, __FILE__, $sql); 


$row = $db->sql_fetchrow($result); 

$usernamecheck = "$row[username]"; 

if ($username != $usernamecheck)


 print "Invalid Username!";


$sql = "SELECT name, value FROM stocks WHERE owner = $username 

if ( ! ($result = $db->sql_query($sql)) )


 message_die(GENERAL_ERROR, \'Could not query stocks.\', \'\', __LINE__, __FILE__, $sql);


while( $row = $db->sql_fetchrow($result) ) 


 print "$row[name]; $row[value]";







Just replace host with localhost, username with USERNAME, and password with PASSWORD if you write a connecting thing.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.