flOid Posted January 8, 2008 Share Posted January 8, 2008 I'm trying to do a search and replace script in my vBulletin database after I did an import from IPB to clean some things up. here's the code: <?php $link = mysql_connect ("localhost", "###", "###"); mysql_db_query("db", "UPDATE post SET pagetext = REPLACE(pagetext,"<!--QuoteBegin-","[quote]")", $link); mysql_db_query("db", "UPDATE post SET pagetext = REPLACE(pagetext,"</div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td>QUOTE","")", $link); mysql_db_query("db", "UPDATE post SET pagetext = REPLACE(pagetext,"UPDATE post SET pagetext = REPLACE(pagetext,"</td></tr><tr><td id='QUOTE'>","")", $link); ?> the error I'm getting is "PHP Parse error: syntax error, unexpected '-', expecting T_PAAMAYIM_NEKUDOTAYIM in searchreplace.php on line 4" What does that mean, and where is the error in my script? Link to comment https://forums.phpfreaks.com/topic/84977-strange-php-error/ Share on other sites More sharing options...
Lumio Posted January 8, 2008 Share Posted January 8, 2008 You have to escape quotes in quotes. "here is a quote \"" So <?php mysql_db_query("db", "UPDATE post SET pagetext = REPLACE(pagetext,\"<!--QuoteBegin-\",\"[quote]\")", $link); ?> Link to comment https://forums.phpfreaks.com/topic/84977-strange-php-error/#findComment-433356 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.