Jump to content

Whats wrong with this code?


Doomflame

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.

 


<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

Archived

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

×
×
  • 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.