Sorry if the title is strangely worded. This is my first time asking anything here, and I'm pretty new to PHP so I'm having a tough time figuring this out.
Basically, I am trying to write a PHP script that will allow me to change the rules for a certain game instance from our website, so I don't have to go into the database and run a SQL query every time.
This is what I have so far:
public function update_rules()
{
$rules = $this->input->post('rules');
$domains = $this->input->post('domains_multiselect');
$qarr = array();
$sql = "
UPDATE domains
SET rules = ?
WHERE domain_id = ?
";
$qarr[] = $rules;
$qarr[] = $domain_id;
$query = $this->db->query($sql,$qarr);
redirect ("admin/insert_rules");
}
I am unsure how to to a substr_replace() to change the "?" placeholders in the query to be able to input both the manually typed rules and the domain_id, which I think will be generated when the domain name is selected.
I could be completely off-base here, but if anyone could point me in some kind of direction, that'd be great. thank you.