_spaz Posted October 16, 2009 Share Posted October 16, 2009 I think I'm in the right area, i was told that AJAX was the better option for what I want to do but I have no idea on how to implement it. I have a table of data that is retrieved from MYSQL with PHP and want to b able to do a mouseover event that highlights a row and then be able to select it if I press the mouse button. Can someone pls point me in the right direction? // Execute the query $result = mysql_query( $query ); if (!$result) { die ("Could not query the database: <br />". mysql_error()); } ?> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Untitled Document</title> <style type="text/css"> <!-- .tabledetail { border-top-width: thin; border-right-width: thin; border-bottom-width: thin; border-left-width: thin; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; } --> </style> <link href="bluedream.css" rel="stylesheet" type="text/css"> </head> <body> <p>Assets Detail:</p> <div align="center"> <table width="200" border="1"> <tr> <th scope="col"> Asset ID</th> <th scope="col"> Filename</th> <th scope="col"> Create Time</th> <th scope="col"> Job Start Time</th> <th scope="col"> Job End Time</th> <th scope="col">Complete %</th> <th scope="col">Job_Name</th> <th scope="col">First Alert Found</th> <th scope="col">Status</th> </tr> <?php while ($result_row = mysql_fetch_row(($result))){ ?> <tr> <td><?php echo $result_row[0]; ?></td> <td><?php echo $result_row[1]; ?></td> <td><?php echo $result_row[2]; ?></td> <td><?php echo $result_row[3]; ?></td> <td><?php echo $result_row[4]; ?></td> <td><?php echo $result_row[5]; ?></td> <td><?php echo $result_row[6]; ?></td> <td><?php echo $result_row[7]; ?></td> <?php if ($result_row[3] <= "" and $result_row[7] <= "") { echo "<td><font color=\"red\">" . "Incomplete/Aborted" ."</font></td>"; } elseif ($result_row[3] >= "" and $result_row[7] <= "") { echo "<td><font color=\"green\">" . "Passed" ."</font></td>"; } elseif ($result_row[7] >= ""){ echo "<td>" . $result_row[8] . "</td>"; } ?> </tr> <?php } ?> </div> </table> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.