Hello,
I am pulling stuff out the database with:
$sql = "SELECT uid,pic_small,title,text_short FROM tbl_products WHERE prod_type='$prod_type' order by prod_type";
$res = mysql_query($sql);
<?
//loop through all results and show them...
while ($item = mysql_fetch_array($res)) {
//if no pic set use default..
if ($item["pic_small"] == "" $item["pic_small"]="no_pic_small.jpg";
?>
print $item[text_short]
}
What I would like is, if $item[text_short] contains a specific phrase, such as 'T shirt' then it prints another phrase underneath, such as 'Best Buy'. If it doesn't match the phrase exactly then nothing is printed.
How can this be done please?
Cheers
James
__________________
It has been said that if you were to put 100 monkeys in a room for an infinite amount of time and gave each one a typewriter, eventually they would reproduce the entire works of Shakespeare. Now, thanks to the Internet, we know that's not true...
James Fielding
I am pulling stuff out the database with:
$sql = "SELECT uid,pic_small,title,text_short FROM tbl_products WHERE prod_type='$prod_type' order by prod_type";
$res = mysql_query($sql);
<?
//loop through all results and show them...
while ($item = mysql_fetch_array($res)) {
//if no pic set use default..
if ($item["pic_small"] == "" $item["pic_small"]="no_pic_small.jpg";
?>
print $item[text_short]
}
What I would like is, if $item[text_short] contains a specific phrase, such as 'T shirt' then it prints another phrase underneath, such as 'Best Buy'. If it doesn't match the phrase exactly then nothing is printed.
How can this be done please?
Cheers
James
__________________
It has been said that if you were to put 100 monkeys in a room for an infinite amount of time and gave each one a typewriter, eventually they would reproduce the entire works of Shakespeare. Now, thanks to the Internet, we know that's not true...
James Fielding