Raised This Month: $ Target: $400
 0% 

Query doesn't work with format?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Migs Davis
Junior Member
Join Date: Mar 2006
Location: Wilton, CT
Old 04-13-2006 , 16:42   Query doesn't work with format?
Reply With Quote #1

It's basically working, except one part. You'll find the line

fResult = dbi_query(forum, "SELECT username FROM `phpbb_users` WHERE user_password = MD5('%s')", Arg2)

in the code somewhere. It checks the password they type in via amx_reg arg1 arg2 against the password stored in the database.. but it doesn't work. When I hardcode my own password instead of %s it works, but if I type my password as arg2 it doesnt. Any ideas?

Code:
public cmd_reg(id){      client_print(id, print_console, "Command Started")      new Arg1[24]      new Arg2[24]      new forumName[15]      new returnName[15]      //Get the command arguments from the console      read_argv(1, Arg1, 23)      read_argv(2, Arg2, 23)      client_print(id, print_console, "Command Got Past Arg Read")      forum = dbi_connect("67.19.24.146","rideout_foruma","password","rideout_phpb1", ferror, 50)      server_print(error)      if (dbc == SQL_FAILED)      {         client_print(id, print_console, "DB connect failed")         new err[255]         new errNum = dbi_error(dbc, err, 254)         server_print("error1: %s|%d", err, errNum)         log_amx("MySQL connect failed")         log_amx(err)      }  else {         client_print(id, print_console, "DB connect Succeeded")         server_print("Connected Successfully To Database")         log_amx("[list] Connected Successfully to Database")         init=1      }      new authid[32]      new num      get_user_authid(id,authid,31)      fResult = dbi_query(dbc,"SELECT forumname FROM list WHERE steamid = '%s'",authid)      if (fResult == RESULT_NONE)         client_print(id, print_console, "You haven't registered a forum name yet")      else if (fResult == RESULT_FAILED)         client_print(id, print_console, "Query Failed")      else {         client_print(id, print_console, "Query Succeeded Too Well")         num = dbi_num_rows (fResult)         client_print(id, print_console, "The number of rows returned is %d", num)         dbi_nextrow (fResult)         dbi_result(fResult, "forumname" ,forumName,14)         client_print(id, print_console, "The value of forumname is %s", forumName)         if ( (forumName[0] == 'N') && (forumName[1] == 'O') && (forumName[2] == 'T') )         {            client_print(id, print_console, "You haven't registered yet, %s, %s", Arg1, Arg2)            fResult = dbi_query(forum, "SELECT username FROM `phpbb_users` WHERE user_password = MD5('%s')", Arg2)            if (fResult == RESULT_NONE)               client_print(id, print_console, "some error none")            else if (fResult == RESULT_FAILED)               client_print(id, print_console, "some error failed")            else {               dbi_nextrow (fResult)               dbi_result(fResult, "username" ,returnName,14)               client_print(id, print_console, "The value of returnName is %s", returnName)            }         }         else         client_print(id, print_console, "You've already registered!")      }      dbi_free_result(fResult)      dbi_close(forum)      return PLUGIN_HANDLED }
__________________
www.kdoubt.net - CS Syndicate website
------
(they need website hits \/\/\/)
www.awesomejon.com - friend's site (check galleries)
www.jednet.com - Friends website (check galleries)
www.djpeak.net - DJ website
Migs Davis is offline
Send a message via AIM to Migs Davis
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:01.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode