Jump to content
MakeWebGames

bindParam -> methodData


Sim

Recommended Posts

I would like to see this added into the next feature of GL to help with the ease of not having to bind every methodData. I'd like to see some sort of function, maybe bindMethodData($exclude) that will automatically bind all the methodData. This would save a ton of time.

bindParam(blah 1, methodData1)

BindParam(blah2, methodData2)

BindParam(blah3, methodData3).

BindParam(blah4, methodData4)

Ext 

BindMethodData will automatically do all that above.

$dontBind[] = 1'

$dontBind[] = 2

bindMethodData('$dontBind).

Will bind the 3 and 4 but not the ones to exclude. Fairly simple to do, and surprised it hasn't been built in yet.

Link to comment
Share on other sites

$insert = $this->db->prepare("
  INSERT INTO skills
  (SK_name, SK_default, SK_max, SK_canUpdate, SK_isHidden)  
	VALUES 	(:name, :defaultValue, :maxValue, :canUpdate, :isHidden);");
  
  $insert->bindParam(":name", $this->methodData->name);
  $insert->bindParam(":maxValue", $this->methodData->maxValue);
  $insert->bindParam(":canUpdate", $this->methodData->canUpdate);
  $insert->bindParam(":isHidden", $this->methodData->isHidden);
  $insert->bindParam(":defaultValue", $this->methodData->defaultValue);
  $insert->execute();

So we usually have to do this for adding form data to the database.

$insert = $this->db->prepare("
  INSERT INTO skills
  (SK_name, SK_default, SK_max, SK_canUpdate, SK_isHidden)  
	VALUES 	(:name, :defaultValue, :maxValue, :canUpdate, :isHidden);");
  
  $insert->bindMethodData();
  $insert->execute();
  
  //first post, exclude excludes which methodDatas to not bind from thrle ye methodDatas
  //$insert->bindMethodData($exclude);

Now the 2nd way is much more convenient. These is especially helpful in the admin panel area where people are adding and edited data all the time. AS YOU can see the 2nd way would b much faster and just more convenient in general  

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...