Link to home
Start Free TrialLog in
Avatar of willwatters
willwatters

asked on

PHP4& MS ACCESS 97

1) How you code a query in PHP4 (with MS ACCESS 97)that requires a Where statement. For example, select * from employee where department = Health?

2) How do you display a checkbox field value in Access 97 to a checkbox on the web using PHP4?

3) How do you display a picture on a web page using PHP4 where the picture name is stored in a MS ACCESS 97 and the picture is actual stored on a windows directory?

Many Thanks

Will
ASKER CERTIFIED SOLUTION
Avatar of carchitect
carchitect

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vulpine
vulpine

Checkboxes in Access are just Yes/No true/False fields, access just puts in checkboxes to make it user friendly. To do this on a php page you would need to use checkboxes and set the default status of the checkbox according to the value in the database. Using the above example, and assuming the access value is yes/no:

<?php
  if($rs->Fields['Available']->Value=='Yes'){
    $checked="CHECKED";
  } else {
    $checked="";
  }
?>

<INPUT TYPE="Checkbox" NAME="Available" VALUE="Yes" <?=$checked?>>

Should help with point no 2
thats right
And point number 3

This is easy just store the location of the graphic in the database.

Or if you kept all your images in the one directory, you would only need to store the image name and then you just add the rest of the dir in the IMG tag. Using the above example:

<IMG SRC="pathto/images/<?=$rs->Fields['ImageName']->Value?>" ALT="This is an image">

Hope it helps

Avatar of willwatters

ASKER

I tried passing in a parameter using the header format but don't know how, can you fix this code please:

header('Location: Customer_Mare_Progress_Status.php’)

?CustomerNo.=<?print $CustomerNo?>