Doomflame Posted April 23, 2003 Share Posted April 23, 2003 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. <html> <head> <title>DFA :: Stocks :: Check Value</title> </head> <body> <?php 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]"; } } ?> </body> </html> Just replace host with localhost, username with USERNAME, and password with PASSWORD if you write a connecting thing. Link to comment https://forums.phpfreaks.com/topic/383-whats-wrong-with-this-code/ Share on other sites More sharing options...
Doomflame Posted April 24, 2003 Author Share Posted April 24, 2003 nevermind. I figured out how Link to comment https://forums.phpfreaks.com/topic/383-whats-wrong-with-this-code/#findComment-1312 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.