sanfly Posted April 27, 2007 Share Posted April 27, 2007 Can you post your code as you currently have it please Link to comment https://forums.phpfreaks.com/topic/48635-while-loop-not-working/page/2/#findComment-240072 Share on other sites More sharing options...
scarface83 Posted April 27, 2007 Author Share Posted April 27, 2007 <?php session_start(); include ('db_connect.inc'); $query = " SELECT TeamRef FROM a_users WHERE Login='$keepit' "; $result = mysql_query($query) or die (mysql_error); // runs the above query $row = mysql_fetch_array($result); $tm = $row['TeamRef'] ; $query2 = "SELECT datestamp, ID FROM absence_mgt WHERE viewable='1' AND TeamRef='$tm'"; $result2 = mysql_query($query2) or die (mysql_error); // runs the above query $row2 = mysql_fetch_assoc($result2); $date_stamp =$row2['datestamp'] ; $new_id = $row2['ID']; list($year,$month,$day) = split("-",$date_stamp); $newdate = $day."/".$month."/".$year; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <link href="/ab_mgt/style.css" rel="stylesheet" type="text/css" /> </head> <body> <div class="title"> <u><b>Pending Absence for your Team</b></u> </div> <div class="pend_subtitle"> Please Confirm if this absence should be saved to your absence calendar ? </div> <div class="back"><a href="main.php">Back</a></div> <div class="pend_absence"> <?php $query3 = mysql_query("SELECT Forename,Surname FROM a_users WHERE In_use='Y' AND Login='$new_id'")or die (mysql_error); $row3 = mysql_fetch_assoc($query3); session_unregister('first'); session_unregister('second'); $first = $row3['Forename']; $second = $row3['Surname']; while ($row2 = mysql_fetch_assoc($result2)){ echo "Date of Absence - ". $newdate." - ".$new_id." - ". $first." ".$second." <a href= 'test' >Save</a>"; } ?> </div> <?php mysql_close(); ?> </body> </html> Link to comment https://forums.phpfreaks.com/topic/48635-while-loop-not-working/page/2/#findComment-240076 Share on other sites More sharing options...
sanfly Posted April 27, 2007 Share Posted April 27, 2007 Okay, Im trying to ignore the fact that I cant make head nor tails of what youre trying to do here, and just concentrate on the code itself. Firstly, are you getting any output at all? Link to comment https://forums.phpfreaks.com/topic/48635-while-loop-not-working/page/2/#findComment-240105 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.