Open
Description
Im trying to convert the following string
x[mark8044][userid:12345]
into ==> x[newusername][userid:12345]
But something is not working here, I have a feeling it has to do with trying to put the prepared statement ?
that sites within a quote '
$userid = 12345;
$oldusername = 'mark8044';
$newusername = 'newusername';
$db->rawQuery("
UPDATE texthistory
SET texthistory = REPLACE(pagetext, 'x['?'][userid:'?']', '@['?'][userid:'?']')
WHERE texthistory LIKE '%@['?'][userid:'?']%'
AND userid = ?", Array($oldusername,$userid,$newusername, $userid, $oldusername, $userid));
Removing the quotes does not seem to work either
$db->rawQuery("
UPDATE texthistory
SET texthistory = REPLACE(pagetext, 'x[?][userid:?]', '@[?][userid:?]')
WHERE texthistory LIKE '%@[?][userid:?]%'
AND userid = ?", Array($oldusername,$userid,$newusername, $userid, $oldusername, $userid));
Metadata
Metadata
Assignees
Labels
No labels