Re: Checkbox and relational table

From: Pedro Graca (hexkid_at_hotpop.com)
Date: 05/04/04


Date: 4 May 2004 21:28:55 GMT

Dominique Javet wrote:
> I've a question regarding the checkbox.
> I've a formular with a list of clients per work experience. I can have
> several clients for a experience. So I have a table for "experience", one
> for "client" and a relational table "rel_experience-client".
> To retrieve the list of clients per work experience I use the query :
> [I]SELECT *
> FROM experience, client, rel_experience_client
> WHERE experience_ref=experience.id AND client_ref=client.id AND
> experience_ref=12345
> ORDER BY libelle[/I]
>
> How can I retrive this information and add a checkbox on each client if they
> are on the experience?
> With the solution below, I can't find the ... solution!

> <?php require_once('../../../Connections/metadeco_connect.php'); ?>
...
> $query_rs7client = "SELECT * FROM client ORDER BY libelle ASC";
> $rs7client = mysql_query($query_rs7client, $metadeco_connect) or die(mysql_error());
...
> if ($totalRows_rs7client>0) {
> $nested_query_rs7client = str_replace("12345", $row_rs7client['id'], $query_rs7client);

There's no "12345" in $query_rs7client
That last statement will always do:
      $nested_query_rs7client = $query_rs7client;

Instead of (or besides) doing a mysql_query($sql, $connection) do a
print($sql) to check what your script is doing.

(snip rest of code)

I think you should first get your data right (check with print_r());
then put it into HTML with checkbox and whatnot.

-- 
USENET would be a better place if everybody read:       : mail address :
http://www.catb.org/~esr/faqs/smart-questions.html      : is valid for :
http://www.netmeister.org/news/learn2quote2.html        : "text/plain" :
http://www.expita.com/nomime.html                       : to 10K bytes :


Relevant Pages

  • Checkbox and relational table
    ... I've a question regarding the checkbox. ... I've a formular with a list of clients per work experience. ...
    (comp.lang.php)
  • Re: tab control issue
    ... When you say 'changes clients' do you mean 'moves to a different record'? ... I have a form with a tab control on it. ... > checkbox at which time the page will then appear. ... what I have a problem with is when the user changes ...
    (microsoft.public.access.formscoding)
  • Re: Selecting records that show in a report
    ... Access adds a Total row to the grid. ... If you actually wanted all clients True, ... This would exclude all the clients where the checkbox is TRUE, ...
    (microsoft.public.access.reports)
  • Re: Selecting records that show in a report
    ... I'm assuming your checkbox is bound to a Yes/No field. ... Candia Computer Consulting - Candia NH ... There is a linking table that links clients to addresses, ... I want a report that will show me all the properties where the checkbox ...
    (microsoft.public.access.reports)
  • RE: highlight a record on the form
    ... I have a form which keep track if my clients got paid or not. ... > trying to highlight (or change font color) of the name ... > on the form when I clicked the checkbox associate with that record. ... > EventProcedure on that checkbox onClick and change forecolor of the textbox, ...
    (microsoft.public.access.formscoding)

Loading