Jump to content

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.

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

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.