dmcdaniel Posted September 7, 2010 Share Posted September 7, 2010 Im fairly new to PHP and have a quick question. I am creating a mail system from scratch and I have two main SQL rows, ID and read. I need to put a link around the ID so that it only pops up in a pop up window that message. This is the coding I have so far, feel free to point out where I have gone wrong: <? include('../config/config.php'); $Query = sprintf("SELECT * FROM qa LEFT JOIN EmployeeInfo ON(qa.Agentsname = EmployeeInfo.Name) WHERE EmployeeInfo.Name LIKE '%s'", mysql_real_escape_string($_SESSION['SESS_NAME'])); $result = mysql_query($Query); $num_rows = mysql_num_rows($result); echo "<table border='0' cellspacing='10' cellpadding='10'>"; echo "<tr>"; echo "<td><strong>Message ID</strong></td><td><strong>Team Lead</strong></td><td><strong>Unread/Read</strong></td><td><strong>Score</strong></td>"; while($row = mysql_fetch_array($result)) { echo "<tr><td><a href='http://10.0.11.5/form/employees/attendance/qaview.php?id='". $row['ID'] . ">" . $row['ID'] . "</a></td><td>" . $row['Name'] . "</td><td>" . $row['read'] . "</td><td>" . $row['Score'] . "</td></tr>"; } echo "</table>"; ?> and this is the qaview.php page <? include('../config/config.php'); $query = doquery("SELECT * FROM qa WHERE ID='$ID'"); $update_query=doquery("UPDATE qa SET read='1' WHERE ID='$ID'"); $row = mysql_fetch_array($query); echo "<td><strong>" . $row['Name'] . "</strong></td></tr>"; ?> Link to comment https://forums.phpfreaks.com/topic/212790-php-link-using-mysql-id/ Share on other sites More sharing options...
ocpaul20 Posted September 8, 2010 Share Posted September 8, 2010 I may have misunderstood this completely, but I think you want a pop up window which is a client side feature. PHP is all done on the server and generates the html for you, before it is rendered and displayed by the browser. I suspect that you will have to organise some kind of ajax call to generate the pop up of the information when they click on the link. Link to comment https://forums.phpfreaks.com/topic/212790-php-link-using-mysql-id/#findComment-1108667 Share on other sites More sharing options...
rwwd Posted September 8, 2010 Share Posted September 8, 2010 I will only say one thing; full tags for php, the use of short tags (between servers) can stop a script in it's tracks if it's not set in the ini file. Always use full tags, good practise & saves headaches later on. Cheers, Rw Link to comment https://forums.phpfreaks.com/topic/212790-php-link-using-mysql-id/#findComment-1108671 Share on other sites More sharing options...
dmcdaniel Posted September 9, 2010 Author Share Posted September 9, 2010 Maybe I didn't clarify properly. Sorry about that. What I want to do is this: Basically, create an internal mailer of sorts. I have a form that places info into a database and places a 0 in the read box (this signifies unread). My first page shows all of the unread messages. Where the message_id is located, I want to create a link to another page so that it ONLY brings up that one message from the database. Is this possible to do in php and mysql? Link to comment https://forums.phpfreaks.com/topic/212790-php-link-using-mysql-id/#findComment-1109238 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.