How do I add a prefixo
before my tabela
in php?
Here is my code below:
$table = 'news AS N, news_category AS NC';
if (strpos($table, ', ') !== false) {
foreach (array($table) as $key => $value) {
$db = $value;
}
echo $db;
} else {
echo 'FAIL';
}
I am returning the following value: news AS N, news_category AS NC
Well now I would like to leave this: prefixo_
news AS N, prefixo_
news_category AS NC , within the code I shared above. Remembering that I do not want to do this: $table = 'prefixo_news AS N, prefixo_news_category AS NC'
in variable $table
, I need inside if
or foreach.
Is it possible?