WebInterface completely broke/bad design. #113


  • New
  • Defect
Open
Assigned to _ForgeUser4509640
  • _ForgeUser1182725 created this issue Dec 23, 2011

    Do NOT use mysql_fetch_row use mysql_fetch_assoc.
    mysql_fetch_row returns an indexed array. Useful when the keys/value pairs do not matter.
    mysql_fetch_assoc returns an associative array. Useful when key/value pairs do matter.
    mysql_fetch_object returns an object. Useful when key/value pairs do matter and you don't want an associative array. (always forget about this guy)

    If the ordering of columns changes the ordering of the indexed array changes. leading to odd bugs. Many of which you are attempting to track down by the looks of complaints and your git commits.

    By using mysql_fetch_assoc the columns can be in any order and will only get messed up if the column name changes. Your code will also be easier to read to anyone that looks at it.

    If you install completely fresh (100% fresh database + latest jar and web interface) your web interface is completely broken because canSell canBuy isAdmin are checked at indexes 4,5 and 6 in the indexed array when they are really 8,9, and 10 on a fresh database. Use mysql_fetch_assoc. You will make life better for yourself and everyone that uses your plugin.

    Thanks.
      --Credomane

  • _ForgeUser1182725 added the tags New Defect Dec 23, 2011
  • _ForgeUser1182725 edited description Dec 26, 2011
  • _ForgeUser1182725 edited description Dec 27, 2011
  • lorenzo_p posted a comment Apr 16, 2012

    no worries. this is already being fixed in web auction plus. if you care to help with the php, I could probably really use it to get this plugin released. still much work to do, cramming the existing php code into the new framework. I'd like to have a working release in a few days, then future releases from there will slowly replace the rest of the code and add more features. I've learned a lot of tricks over the years and I'm putting them all to use. I think I have some beautiful code coming together.


To post a comment, please login or register a new account.