swaping text between recordsets -
07-12-2004
, 08:54 AM
Newbee Question, "idiots guide style answers please!"
Macromedia MX 2004, php <> MySql
in the database there is an soccer events table, one of these records will be
flagged as "main = Y"
I have a form with 2 recordsets
1 is the single "rs_main" record
2 is "rs_list" of all sports Events where "archived = N"
I have a table with rs_list.Title and a hidden field with rs_list.id
All that is working fine!.
But:
I want to create a 3rd select recordset and put it inside a function, so when
I click on the list, it gets the record for rs_list.id
Populates the rs_main.title, rs_main.description and rs_main.author.
1. How do i declare a function and where do I put the code ?
BLANK
2. do I need a 3rd recordset & form variable or can it just be coded somethin
like this fill the blanks please?
mysql_select_db($database_soccer, $soccer);
$query_rs_swap = sprintf("SELECT author, title, description FROM event WHERE
id = %s", "BLANK ??");
$rs_swap = mysql_query($query_rs_swap, $soccer) or die(mysql_error());
$row_rs_swap = mysql_fetch_assoc($rs_swap);
$totalRows_rs_swap = mysql_num_rows($rs_swap);
3. how do I then put the rs-swap.author "value" into the rs_main.author on the
form?
BLANK
4. then how do I action the click event to call the function?
BLANK
I know to some of you guys this is basic code, but it is a whole new language
to me!
Thanks in advance !
Dave |