HELP ON CODES: Writng a new plugin
-
I’ve been trying to solve this for three days now but no success and it’s getting stressing. I hope you guy out there can help me out and explain to me what is wrong with the code.
The code is to look for
[DATA:<- ID OF THE DATA IN MYSQL ->] on the content page and replace it with the ID’s title.eg: [DATA:2] = < b >This is info for ID 2 < /b >
Everything work perfectly until i added the codes with the Asterik ‘*’… and all I get is blank. No result, nothing… not even the [Data:2] tag.Please help.
==================================
function scannow ($content) {
$CODE = ‘/\[DATA\:(.*?)\]/is’;
$VALUE = ‘$1’;* $result = mysql_query(“SELECT * FROM wp_datastructure WHERE option_id = ‘$VALUE'”);
* $row = mysql_fetch_array($result);
* $VALUE = $row[‘option_name’];$content = preg_replace($CODE, $VALUE, $content);
return $content;
}PS: I know this is not a php support website. Why I putting it here and ask for assistance is because, it’s for WP plugin and all WP tags and functions in query stuff are not quite familiarize by me.
The topic ‘HELP ON CODES: Writng a new plugin’ is closed to new replies.