Jump to content


Photo

Whats wrong with this code?


  • Please log in to reply
1 reply to this topic

#1 Doomflame

Doomflame
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 23 April 2003 - 02:07 AM

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.

#2 Doomflame

Doomflame
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 24 April 2003 - 05:24 PM

nevermind.

I figured out how :D




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users