xupaosso
05-07-2004, 07:29 PM
What am I doing wrong here? I've tried to make this work so many different ways! All I want to do is pull the second field information if the first field matches the selected statement. So far I've been successful in linking to the database, for
example,
(where $nr=Number of records and $dbi=Database)
echo "<select>";
for ($i=1; $i <= $nr; $i++) {
$rec = dbase_get_record($dbi,$i);
echo "<option>",$rec[0]," --- ",$rec[1], " --- ", $i, "</option>";
}
echo "</select><br>";
works fine, but I can't get this:
for ($i=1; $i <= $nr; $i++) {
$rec = dbase_get_record($dbi,$i);
if($rec[0] == "WASSER"){
echo $rec[1];}
}
to work!
example,
(where $nr=Number of records and $dbi=Database)
echo "<select>";
for ($i=1; $i <= $nr; $i++) {
$rec = dbase_get_record($dbi,$i);
echo "<option>",$rec[0]," --- ",$rec[1], " --- ", $i, "</option>";
}
echo "</select><br>";
works fine, but I can't get this:
for ($i=1; $i <= $nr; $i++) {
$rec = dbase_get_record($dbi,$i);
if($rec[0] == "WASSER"){
echo $rec[1];}
}
to work!