09-20-2007, 01:08 PM
|
#12 (permalink)
|
|
The Reckoner
Join Date: Sep 2007
Posts: 437
Thanks: 22
|
Almost, just a few minor adjustments.
PHP Code:
<?php $sql = sprintf('INSERT INTO %1$s (username, password, registerdate, registerip) VALUES ("%2$s", "%3$s", "%4$s", "%5$s") ON DUPLICATE KEY UPDATE username = "%2$s", password = "%3$s", registerdate = "%4$s", registerip = "%5$s"', $this->table['members'], $this->data['username'], $this->data['password'], $this->data['registerdate'], $this->data['registerip']);
$this->db->query($sql);
?>
If the sprintf placeholders are confusing you in this example, I'd suggest reading Salathe's article which explains how to use them properly, the article can be viewed here.
|
|
|
|