show if
Hey Ray
How would you set up a show if based on whether or not a column contains a specific word?
Cheers
Jamie
Hey Ray
How would you set up a show if based on whether or not a column contains a specific word?
Cheers
Jamie
<?php
if (strpos($Recordset->getColumnVal("column"), "word") !== false) {
// has the word
} else {
// doesn't
}
?>
thanks Ray but cant get that to work....
It should work... I'd have to see your code to see where you made a mistake.
it seems that its only checking the first record for that column rather than all records for that column
this is what I have used:
<?php if (strpos($Downloads->getColumnVal("DownloadManufacturer"), "fnf") !== false) { ?>
Yes... that is what it does... you didn't say check all rows.
Are you doing it at the end of a loop after displaying all of the records you want checked or before? What exactly are you using this for?
sorry :S
just wanting to hide a bit of content unless a specific word is found in a specific column across all results
<?php
$foundInColumn = false;
for ($x=0; $x<sizeof($Downloads->Results); $x++) {
if (strpos($Downloads->Results[$x]["DownloadManufacturer"],"fnf") !== false) $foundInColumn = true;
}
if ($foundInColumn) {
// found
} else {
// not found
}
?>
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.