Re: Checkbox and relational table
From: Pedro Graca (hexkid_at_hotpop.com)
Date: 05/04/04
- Next message: Daniel Tryba: "Re: Reality Check: Session Hijacking"
- Previous message: Daniel Morgan: "Re: What so special about PostgreSQL and other RDBMS?"
- In reply to: Dominique Javet: "Checkbox and relational table"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 :
- Next message: Daniel Tryba: "Re: Reality Check: Session Hijacking"
- Previous message: Daniel Morgan: "Re: What so special about PostgreSQL and other RDBMS?"
- In reply to: Dominique Javet: "Checkbox and relational table"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|