Okay, I'm lost. I'd like to have a visitor (who's logged in already) be able to change the status of a particular record. This record is in a repeat region, and I have a small graphic that the user would click on, and that particular record status would change.

I have no clue how to do this, and I've tried a number of different code variations to no avail... I'm stumped!

Here's a sample of my code... notice the image that I would like to have "clickable" and tied to a record update. I really would prefer not to have a separate "submit" button. Is this possible?

<?php do { ?>
                <tr bgcolor="<?php if ($BRB_rowcounter++%2==0){?>#E2E2E2<?php }else{ ?>#F2F2F2<?php }?>" valign="middle"> 
                  <td width="75"><div align="center"><font size="2" face="Geneva, Arial, Helvetica, sans-serif"><a href="http://mywebsite.com/<?php echo $row_rsUserDetails['temp_msg_loc'];?>"><img src="images/playbutton.gif" alt="play voice mail message" border="0"></a></font></div></td>
                  <td width="100"><div align="right"><font size="2" face="Geneva, Arial, Helvetica, sans-serif"><?php echo $row_rsUserDetails['msg_status']; ?></font></div></td>
                  <td width="150"><div align="right"><font size="2" face="Geneva, Arial, Helvetica, sans-serif"><?php echo $row_rsUserDetails['msg_ani']; ?></font></div></td>
                  <td width="100"><div align="right"><font size="2" face="Geneva, Arial, Helvetica, sans-serif"><?php echo $row_rsUserDetails['creat_date']; ?></font></div></td>
                  <td width="100"><div align="right"><font size="2" face="Geneva, Arial, Helvetica, sans-serif"><?php echo $row_rsUserDetails['creat_time']; ?></font></div></td>
                  <td width="75"><div align="center"><font size="2" face="Geneva, Arial, Helvetica, sans-serif"><img src="images/deletebutton.gif" alt="delete voice mail message" width="17" height="17" border="0"></font></div></td>
                </tr>
                <?php } while ($row_rsUserDetails = mysql_fetch_assoc($rsUserDetails)); ?>

So, above, the "deletebutton.gif" would be the image I'd like to have clickable to change the $row_rsUserDetails['msg_status']; to DELETE. (no... I do not actually want to delete the record, just update the msg status to indicate a status of DELETE.)

Additionally, the "playbutton.gif" button above I'd like to have not only play the asf file, (which it's doing fine at the moment) but also attach an update mySQL to update the msg status to "Saved".

How can I do this? I'd be eternally grateful to anyone who could give me some suggestions... thanks in advance!!!

...Tanya

ps: if you need to have more of the code, let me know!

    you can't start a code in a php tag, and end it in another php tag

    <?php do { ?>

    <?php } while ($row

    you'll get parse errors

      Hi,

      So you have a clickable image and you want to update a record when the user clicks on it? Why not have the link go to a php page that does the update and then after that, redirect the user back to the page you wish. Any variables that you need to make the update could be passed to the page adding variables to the end of the <a>samplepage.php?username=$row[username]</a> etc

      This is fine as long as there is no sensitive information being shown i.e. password

      On the following page you would do your sql update

      UPDATE mydata SET ... WHERE UserName = '$username'

        Hi, thanks for your response.

        I'm really after making it easy for someone to simply click on an image and have the status change.

        I know the code is wrong, but this is something like what I'm trying to make work:

        <form action="POST">
        <?PHP UPDATE message SET msg_status = 'DELETE' WHERE u_code = $rsUserDetails ?>
        <input name="formupdate" type="image" src="images/deletebutton.gif">
        </form>

        Can someone help me refine this bit of code so that it actually works to update that particular record in the recordset?

        Thanks again!!
        ...Tanya

          <?php
          mysql_connect("localhost","webchick","her_pass");
          mysql_select_db("web_chicks_db");
          mysql_query("UPDATE_message_SET_msg_status='DELETE'_WHERE_u_code='$rsUserDetails'");
          mysql_close();
          ?>

          above code will work fine..

          or..

          <?php
          if(isset($update)){
          mysql_connect("localhost","webchick","her_pass");
          mysql_select_db("web_chicks_db");
          mysql_query("UPDATE_message_SET_msg_status='DELETE'_WHERE_u_code='$rsUserDetails'");
          mysql_close();
          }
          ?>

            wow the forum really screwed my code.
            if you got MSN/ICQ or AIM add me and ill paste it to you ;-)
            AIM: ryzaDelux
            ICQ: 163049180
            MSN: napam21@hotmail.com

            ryza.

              Hi ryza,

              Thanks...! But, how can I make that function only when the user clicks on the image?

              Your help is very appreciated!

              Tanya.

                Write a Reply...