
Im stuck with pulling array elements from mysql DB with PHP please help
First I used
$keyword_one = $result['keyword_one'];
$keyword_two = $result['keyword_two'];
$keyword_three = $result['keyword_three'];
$keyword_four = $result['keyword_four'];
$keyword_five = $result['keyword_five'];
$keyword_multi = $result['keyword_multi'];
$input = array($keyword_one, $keyword_two, $keyword_three, $keyword_four, $keyword_five);
$keyword = array_rand($input);
// echo $input[$keyword];
?>
and i worked fine, but I didnt want a brand new column in the DB for every snippet so I tried this
$keyword_one = $result['keyword_one'];
$keyword_two = $result['keyword_two'];
$keyword_three = $result['keyword_three'];
$keyword_four = $result['keyword_four'];
$keyword_five = $result['keyword_five'];
$keyword_multi = $result['keyword_multi'];
$input = array($keyword_multi);
$keyword = array_rand($input);
// echo $input[$keyword];
?>
and stored this in the DB
'best rated e cigarette 2017', 'most popular e cig 2017', 'best priced e cigarette', 'number one voted e cigarette worldwide', 'the longest established e cig supplier','number one e cig 2017', 'get healthy with e cigs', 'forget the craving smoke anywhere', 'we all love to smoke and with this e cig you can do it anywhere', 'the new super e cigarette for everyone'
can anyone tell me where im going wrong or do I need to use a different column for every keyword??
I want to do this with random content sections to but a column per one would be a nightmare
can anyone help please
I'm part of the Warrior Forum team, hit me up with any suggestions that could help improve the forum!
I'm part of the Warrior Forum team, hit me up with any suggestions that could help improve the forum!