PHP - Do Not Repeat Same Names From Fetched Rows
i want to fetch contributors in adding certain articles... so its like
select contributors from table where id=id the table looks like this. title contributor ---------------------------------- art1 me art2 me art3 you art4 me art5 you I then need to echo the contributors... what do i do so that it echoes one name only once, no duplicates... thanks. I tried searching google but im not sure about my keywords Similar TutorialsI am pulling 5 addresses and I am wanting to store these 5 addresses in columns in a separate table. On the query string I put LIMIT 5. How can I store the results of each of the 5 loops into columns in a separate table? The columns are A1(for name), A2(for address), A3 (for city), A4 (for state), A5 (for zip), A6 (for phone), A7 (for miles), .... then I also have B1-B7, C1-C7, D1-D7, and E1-E7. I am basically wanting to store up to 5 addresses in an array and then update them into a mysql table. Code: [Select] foreach ($zips as $key => $value) { $result = mysql_query("SELECT State FROM extreme WHERE Zip = '$key' AND Type='store' AND `InStore` <> 'NO' LIMIT 5", $db); $num_rows = mysql_num_rows($result); while($myrow = mysql_fetch_array ($result)) { $Dealer=$myrow['Dealer']; $Address=$myrow['Address']; $City=$myrow['City']; $State=$myrow['State']; $Zip=$myrow['Zip']; $Phone=$myrow['Phone']; $Miles = $value; } } Hi Good day Can someone pls help me regarding with this matter. I have a page for inserting records. And I have a combobox that is fetched through the specific field in database. I also have a table of records, for each row i have an href edit which throws the values to its respective texbox and combobox. THE PROBLEM is that when i click the href edit, the value from a selected row was not displayed from the combobox My Php Buddies, I have mysql tbl columns these:
id: Now, I want to display their row data by excluded a few columns. Want to exclude these columns: date_&_time account_activation_code account_activation_status id_verification_video_file_url password
So, the User's (eg. your's) homepage inside his account should display labels like these where labels match the column names but the underscores are removed and each words' first chars CAPITALISED:
Id: 1
For your convenience only PART 1 works. Need help on Part 2 My attempted code:
PART 1 <?php // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } // Query to get columns from table $query = $conn->query("SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'members' AND TABLE_NAME = 'users'"); while($row = $query->fetch_assoc()){ $result[] = $row; } // Array of all column names $columnArr = array_column($result, 'COLUMN_NAME'); foreach ($columnArr as $value) { echo "<b>$value</b>: ";?><br><?php } ?> PART 2 <?php //Display User Account Details echo "<h3>User: <a href=\"user.php?user=$user\">$user</a> Details</h3>";?><br> <?php $excluded_columns = array("date_&_time","account_activation_code","account_activation_status","id_verification_video_file_url","password"); foreach ($excluded_columns as $value2) { echo "Excluded Column: <b>$value2</b><br>"; } foreach ($columnArr as $value) { if($value != "$value2") { $label = str_replace("_"," ","$value"); $label = ucwords("$label"); //echo "<b>$label</b>: "; echo "$_SESSION[$value]";?><br><?php echo "<b>$label</b>: "; echo "${$value}";?><br><?php } } ?> PROBLEM: Columns from the excluded list still get displayed. Edited November 19, 2018 by phpsane<script type="text/javascript"> what Im basically trying to do is just like a phpmyadmin function... you select rows you want to update with a checkbox and then it takes you to a page where the rows that are clicked are shown in forms so that you can view and edit info in them... and then have 1 submit button to update them all at once. I have 2 queries that I want to join together to make one row
hi, is there a way to tell php to do a process again? example: Code: [Select] $draft_number=rand(1, 15); if($draft_number == 5){ START OVER AT TOP } else { $sql1 = "UPDATE names SET draft = '$draft_number' WHERE id = '$uid'"; $result1 = mysql_query($sql1) or die('Error, Check you fields and try again.'); } I have a script that opens up a CSV file and outputs to a table for testing. It ultimately inserts into a MySQL but the code below literally duplicates every third row consistently. I'm 95% sure its in the "WHILE" area. Is there enough code here for someone to point out an error. If not I can put the code up live and if you want a fee for fixing just PM me please. Code: [Select] $fp = fopen("residential-data.csv", "r"); $listings=-1; function getZip($full) { $pieces = explode(' ', $full); $zip = explode('(', $pieces[count($pieces)-1]); $zip = explode(')', $zip[1]); return $zip[0]; } $pre=""; while (($data = fgets($fp,4096)) !== FALSE) { $data=str_replace("\r\n","",$data); if(trim($data)=="" or substr($data,strlen($data)-1,1)!='"' or substr($data,strlen($data)-2,2)==',"') { $pre.=$data; } I have simple script here that uses curl to post to a few forms and send receive cookies. Now whenever I run the script it takes 10 seconds for the whole process to finish . Is it possible to reduce this time whenever the script is run the second or third.. time. my english is poor , i am having difficulty in putting words to what I want to say... But what I want is for the script to somehow use the previous cookies , detect if they are expired and then do things accordingly(run only the last block of code , if cookie hasn't expired) . How do I go about doing this ? any suggestions ? Thanks The script: Code: [Select] <?php //Create File // $ckfile = tempnam("","testfile.tmp") ; $ckfile = "testFile.tmp"; $ourFileHandle = fopen($ckfile, 'w') or die("can't open file"); fclose($ourFileHandle); //goto home page , to get initial cookies (not required the second time) $ch = curl_init ("http://pericles.ipaustralia.gov.au/atmoss/falcon.application_start"); curl_setopt ($ch, CURLOPT_COOKIEJAR, $ckfile); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); $output = curl_exec ($ch); ////click on enter as guest. and post the info from te form. $ch = curl_init ("http://pericles.ipaustralia.gov.au/atmoss/Falcon_Users_Cookies.Run_Create"); curl_setopt ($ch, CURLOPT_COOKIEFILE, $ckfile); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt ($ch, CURLOPT_POSTFIELDS, "p_JS=N&p_Anon=ANONYMOUS&p_user_type=Enter as Guest"); curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt ($ch, CURLOPT_COOKIEJAR, $ckfile); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); $output = curl_exec ($ch); //open the search page. $ch = curl_init ("http://pericles.ipaustralia.gov.au/atmoss/Falcon.Search_Screen?p_search_no=0&p_SearchLevel=FULL"); curl_setopt ($ch, CURLOPT_COOKIEFILE, $ckfile); curl_setopt ($ch, CURLOPT_COOKIEJAR, $ckfile); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); $output = curl_exec ($ch); //search on the search page. $ch = curl_init ("http://pericles.ipaustralia.gov.au/atmoss/Falcon.Result"); curl_setopt ($ch, CURLOPT_COOKIEFILE, $ckfile); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt ($ch, CURLOPT_POSTFIELDS, "p_partword_1=nice"); curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt ($ch, CURLOPT_COOKIEJAR, $ckfile); curl_exec ($ch); //fclose($ourFileHandle); ?> Also for some reason the cookie file ends up being a zero byte file. any one know why I have this code which checks for the word "Big Ben" and if it's not there it outputs some html. I want t be able to make another statement to also check for the word "London Tower" and if it's not there then to check for the word "Canary Wharf", So far I've only managed one statement without the code breaking, how do I add the others in as well. <?php $astacker=get_post_meta($post->ID, 'thesite', true); if ( $astacker == [b]'Big Ben'[/b]) { ?> <?php include(TEMPLATEPATH."/feedsgrabstack.php");?> <?php }else { ?> <div id="splitter"><div class="clear"> <a href="<?php echo get_post_meta($post->ID, "linktosource", true);?>">Click Here To View Answers</a> <span style="float:right;"><a href="#related">See Related Questions</a></div></div> <?php } ?> Hello, I need help in making my script loop indefinitely. Any ideas? Hi Everyone, could anyone tell me why this only shows one record. There is at least four that will match the query. case 'jayzquotes'; echo '<table border="0" cellspacing="0" cellpadding="2"><tr><td><h1>Jay-Z Quotes</h1></td></tr></table><br>'; echo '<table width="600" border="0" cellspacing="0" cellpadding="2">'; $result = mysql_query("SELECT * FROM quotes WHERE artist LIKE 'J%' and approved = 'y'") or die(mysql_error()); $count = mysql_num_rows ($result ); while($row=mysql_fetch_array($result)){ $resultb = mysql_query("SELECT * FROM comments WHERE quoteid=".$row['quoteid']."") or die(mysql_error()); while($link=mysql_fetch_array($resultb)){ $date = $row[date]; $user = $row[user]; $email = $row[email]; $artist = $row[artist]; $song = $row[song]; $quote = stripslashes($row[quote]); $quoteid = $row[quoteid]; $votes = $row[votes]; echo ' <tr> <td width="424"><strong>Date Submitted:</strong><span class="red"> '.$date.'</span></td> <td width="156" align="right"><strong>Total Votes</strong> (<span class="red">'.$votes.'</span>)</td> </tr> <tr> <td colspan="2"><strong>Quote submitted by:</strong><span class="red"> '.$user.' </span>- <span class="red"><a href="mailto:'.$email.'">'.$email.'</a> </span></td> </tr> <tr> <td colspan="2"><strong>Artist:</strong> <span class="red">'.$artist.' </span></td> </tr> <tr> <td colspan="2"><strong>Song name:</strong> <span class="red">'.$song.' </span></td> </tr> <tr> <td colspan="2"><strong>Quote:</strong><hr></td> </tr> <tr> <td colspan="2">'.$quote.'</td> </tr> <tr> <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="5" class="quotefooter"> <tr> <td><strong>(<span class="dark">'.$countb.'</span>) Comments: View / Edit Comments</strong></td> <td align="center"><strong><a href="index.php?action=editquote"eid='.$quoteid.'" target="_self">Edit Quote</a></strong></td> <td align="center"><strong><a href="index.php?action=deletequote"eid='.$quoteid.'">Delete Quote</a></strong></td> </tr> </table><br><hr></td> </tr> '; } } echo '</table>'; echo '<strong>Total Results</strong><span class="red"> '.$count.'</span>'; break; hey guys
Doing last bit of site now and after doing full testing I found 1 little bug that I don't like I created an appointment section with a table to display resuilts from mysql, works great, but add more than 1 appiontment and its almost adding a whole new page See attachment for pic Heres the code for the table <?php echo '<h2>Customer Appointments</h2>'; ?> </span></div><table width="1248" border="3" align="center"> <tr class="new"> <td width="116" class="re" style="text-align: center"><strong>Date Booked</strong></td> <td width="96" class="re" style="text-align: center"><strong class="table">Time Booked</strong></td> <td width="823" class="re" style="text-align: center"><strong class="table">Notes</strong></td> </tr> <?php do { ?> <tr class="table"> <td class="re" style="text-align: center; color: #FFF;"><?php echo $row['datebooked']; ?></td> <td class="re" style="text-align: center"><?php echo $row['timebooked']; ?></td> <td class="re" style="text-align: center"><?php echo $row['notes']; ?></td> </tr> <?php } while ($row = mysql_fetch_assoc($Recordset1)); ?> </table> <span class="re"> <?phpIs there anyway I can make the Titles: Date Booked, Time Booked, Notes and have all results showing directly underneath? Attached Files success.JPG 31.29KB 0 downloads This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=316681.0 How do you make php code repeat for a certain amount of times. I am only new to php and I am trying to make the code below repeat 6 times instead of repeating all the matching elements in the database. From my other coding experience I would use a for loop but as I am new to php I am not really sure how to implement the for and while loops together. I was trying to add an integer that incremented until it hit 6 and then would exit the while loop but I couldn't get it to work. This is probably a simple problem and any help would be appricated. Thanks. Code: [Select] <?php $subject_set = mysql_query("Select * FROM movies WHERE media = 'Movies' ORDER BY dateadded DESC", $connection); if (!$subject_set){ die("Database connection failed: " . mysql_error()); } while ($subject = mysql_fetch_array($subject_set)){?> <div class="par_element"> <div class="repeat_horizontal"> <div class="repeat_hor_picture"> <a href="<?=$subject['link']?>"> <img src=" <?=$subject['picture']?>" /></a> </div> <a href=" <?=$subject['link']?>"><?= $subject['title']?>.</a> </div> <?php } ?> Hey guys, bascially I'm developing a simple news script, and part of it has a "quick news" section, which will display the latest 3 (or any number I want) news items, each seperated by a line (<hr> in the example below). What I want to acheive is the top 2 news items have a set LI class assigned to them, and then the 3rd LI in the list to have a different style attached to it (one without a bottom border basically), so it'll bascially repeate out the normal <li> until it hits the last item to be output, at which point it uses a LI with a class attached to it. What I don't know how to do, is tell the PHP that once it's out putted 2 LI's, then the 3rd LI is to have a different class on it. eg Code: [Select] <li>News Item 1</li> <li>News Item 2</li> <li class="last">News Item 3</li> I'm pretty new to PHP so not sure how to achieve this and would appreicate any help you can offer. Here's my code so far... Code: [Select] <?php $latestnews_sql = "SELECT * FROM news ORDER BY date DESC LIMIT 3"; $latestnews_query = mysql_query($latestnews_sql) or die (mysql_error()); $list_latestnews = mysql_fetch_assoc ($latestnews_query); ?> <ul> <?php do { ?> <li><p><strong><?php echo $list_latestnews['title']; ?></strong></p> <?php echo substr($list_latestnews['body'],0,80)."...";?> <a href="news-detail.php?ID=<?php echo $list_latestnews['ID']; ?>">view more</a></p> <p><span style="font-size:13px; font-style:italic;"><?php echo $list_latestnews['author']; ?> - <?php echo date("l, jS F Y", strtotime($list_latestnews['date'])); ?></span></p> <hr /> </li> <?php } while ($list_latestnews = mysql_fetch_assoc ($latestnews_query)) ?> </ul> I was hard code to make if condition until like seem. But its to hard to write. if ($lebar == 41) { $x = 1; } else if ($lebar == 42) { $x = 2; } else if ($lebar == 43) { $x = 3; } else if ($lebar == 44) { $x = 4; } else if ($lebar == 45) { $x = 5; ..... } else if ($lebar == 490) { $x = 450; } How to make it simple with looping or any clue? Hi, i m new with php programming... I m working on one form in which i have created filter options for filter dynamic table content by completed, approve and rejected status.... but problem is when i m selecting any filtered option using select list data is displayed... but when i m clicking on next button in paging... dynamic table showing blank... same slect list getting blank.... anyone will help me...? code of php file Code: [Select] <?php require_once('../Connections/localhost.php'); ?> <?php if (!isset($_SESSION)) { session_start(); } $MM_authorizedUsers = "client"; $MM_donotCheckaccess = "false"; // *** Restrict Access To Page: Grant or deny access to this page function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) { // For security, start by assuming the visitor is NOT authorized. $isValid = False; // When a visitor has logged into this site, the Session variable MM_Username set equal to their username. // Therefore, we know that a user is NOT logged in if that Session variable is blank. if (!empty($UserName)) { // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. // Parse the strings into arrays. $arrUsers = Explode(",", $strUsers); $arrGroups = Explode(",", $strGroups); if (in_array($UserName, $arrUsers)) { $isValid = true; } // Or, you may restrict access to only certain users based on their username. if (in_array($UserGroup, $arrGroups)) { $isValid = true; } if (($strUsers == "") && false) { $isValid = true; } } return $isValid; } $MM_restrictGoTo = "../index.php"; if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) { $MM_qsChar = "?"; $MM_referrer = $_SERVER['PHP_SELF']; if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&"; if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0) $MM_referrer .= "?" . $_SERVER['QUERY_STRING']; $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer); header("Location: ". $MM_restrictGoTo); exit; } ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $currentPage = $_SERVER["PHP_SELF"]; $maxRows_Recordset1 = 30; $pageNum_Recordset1 = 0; if (isset($_GET['pageNum_Recordset1'])) { $pageNum_Recordset1 = $_GET['pageNum_Recordset1']; } $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1; $myID = $_SESSION['MM_Username']; $mystatus=$_GET['status']; switch ($options) { case "All"; $All="selected"; break; case "Completed"; $Completed="selected"; break; case"Rejected"; $Rejected="selected"; break; case"Pending"; $Pending="selected"; break; } $mystatus=$_POST['status']; $maxRows_Recordset1 = 10; $pageNum_Recordset1 = 0; if (isset($_GET['pageNum_Recordset1'])) { $pageNum_Recordset1 = $_GET['pageNum_Recordset1']; } $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1; //databse queary for filters $query_Recordset1 = "SELECT username, Jobid, Market, General_10, Entry_Points, Dept_Points, General_Points, Total_Points FROM form_gf "; if($mystatus !=='All'){ $query_Recordset1 .= "WHERE status = '$mystatus'";} else { $query_Recordset1 .= "ORDER BY form_gf.Jobid";} mysql_select_db($database_localhost, $localhost); $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1); $Recordset1 = mysql_query($query_limit_Recordset1, $localhost) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); if (isset($_GET['totalRows_Recordset1'])) { $totalRows_Recordset1 = $_GET['totalRows_Recordset1']; } else { $all_Recordset1 = mysql_query($query_Recordset1); $totalRows_Recordset1 = mysql_num_rows($all_Recordset1); } $totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1; mysql_select_db($database_localhost, $localhost); $query_status = "SELECT dropdown.options FROM dropdown WHERE dropdown.dropdownname = 'status'"; $status = mysql_query($query_status, $localhost) or die(mysql_error()); $row_status = mysql_fetch_assoc($status); $totalRows_status = mysql_num_rows($status);mysql_select_db($database_localhost, $localhost); $query_status = "SELECT options FROM dropdown WHERE dropdownname = 'status' ORDER BY options ASC"; $status = mysql_query($query_status, $localhost) or die(mysql_error()); $row_status = mysql_fetch_assoc($status); $totalRows_status = mysql_num_rows($status); $queryString_Recordset1 = ""; if (!empty($_SERVER['QUERY_STRING'])) { $params = explode("&", $_SERVER['QUERY_STRING']); $newParams = array(); foreach ($params as $param) { if (stristr($param, "pageNum_Recordset1") == false && stristr($param, "totalRows_Recordset1") == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams)); } } $queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1); ?> <!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=utf-8" /> <title>Brakedown Report</title> <link href="../template.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="../Menu/js/jquery.js"></script> <script type="text/javascript" src="../Menu/js/interface.js"></script> <script type="text/javascript" src="../Menu/js/fisheye_patched.js"></script> <!--[if lt IE 7]> <style type="text/css"> .dock img { behavior: url(iepngfix.htc) } </style> <![endif]--> <link href="../Menu/style.css" rel="stylesheet" type="text/css" /> <style type="text/css"> .Header { font-family: "Segoe UI"; font-size: 12px; font-weight: 500; color: #CCC;} .table { font-family: "Segoe UI"; font-size: 10pt; border: 1px solid #000; } .text { font-family: "Segoe UI"; font-size: 10pt; } a { font-family: "Segoe UI"; font-size: 12px; color: #333; font-weight: bold; } a:link { text-decoration: none; } a:visited { text-decoration: none; color: #333; } a:hover { text-decoration: none; color: #36F; } a:active { text-decoration: none; color: #333; } </style> </head> <body> <!--Wrapper Start--> <div id="wrapper"> <!--Header Start--> <div id="header"> <div id="logo"><img src="../images/logo.png" alt="isnlogo" width="64" height="30" align="middle" longdesc="http://www.isngs.com" /></div> <div id="userinfo"> <table width="180" border="0" align="right" cellpadding="0" cellspacing="0"> <tr> <td width="27" height="34"><img src="../images/user.png" width="26" height="30" alt="user" /></td> <td width="77">Sagar Dhande</td> <td width="26"><img src="../images/arrow.png" width="26" height="30" alt="arrow" /></td> </tr> </table> </div> <div id="status"></div> </div> <!--Header end--> <div id="content"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr align="center"> <td width="99%"> <div id="dash3"> <div id="dash3_grid_head">Total Reccords </div> <div id="dash3_grid_cont_back"><br /> <table width="890" border="0" align="center" cellpadding="0" cellspacing="0" class="table"> <tr class="Header"><form action="" method="post"> <td height="55" colspan="3" align="center" valign="middle" id="filters">Filter By Status</td> <td align="left" valign="middle"><select name="status" id="status2" onchange="document.forms[0].submit();"> <option value="" <?php if (!(strcmp("", $mystatus))) {echo "selected=\"selected\"";} ?>></option> <?php do { ?> <option value="<?php echo $row_status['options']?>"<?php if (!(strcmp($row_status['options'], $mystatus))) {echo "selected=\"selected\"";} ?>><?php echo $row_status['options']?></option> <?php } while ($row_status = mysql_fetch_assoc($status)); $rows = mysql_num_rows($status); if($rows > 0) { mysql_data_seek($status, 0); $row_status = mysql_fetch_assoc($status); } ?> </select></td> <td align="left" valign="bottom"><a href="excel.php"></a></td> <td align="left" valign="bottom"> </td> <td align="center" valign="middle"><a href="../excelexprt.php"></a></td> <td align="center" valign="middle"> </td> <td align="center" valign="middle"> </td> <td align="right" valign="middle"><a href="excel.php"><img src="../images/Export.png" alt="Export" width="48" height="48" border="0" /></a></td> </form> </tr> <tr class="Header"> <td height="2" colspan="10" align="center" valign="bottom" id="filters3"><hr color="#333333" size="1px"/></td> </tr> <tr class="Header"> <td height="345" colspan="10" align="center" valign="bottom" id="filters"><a href="../excelexprt.php"> <iframe src="pai1.php" width="485px" height="370px" frameborder="0"></iframe> </a></td> </tr> <tr class="Header"> <td height="22" colspan="3" align="center" valign="bottom" id="filters2"> </td> <td align="left" valign="bottom"> </td> <td align="left" valign="bottom"> </td> <td align="left" valign="bottom"> </td> <td colspan="4" align="center" valign="middle"> </td> </tr> <tr class="Header"> <td style="border: 1px solid #000;" height="44" colspan="3" align="center" valign="middle" bgcolor="#666666">Options</td> <td style="border: 1px solid #000;" width="100" align="center" valign="middle" bgcolor="#666666" class="Header">Job ID</td> <td style="border: 1px solid #000;" width="100" align="center" valign="middle" bgcolor="#666666">Market ID</td> <td style="border: 1px solid #000;" width="100" align="center" valign="middle" bgcolor="#666666">Transaction No.</td> <td style="border: 1px solid #000;" width="100" align="center" valign="middle" bgcolor="#666666">Entry Points</td> <td style="border: 1px solid #000;" width="100" align="center" valign="middle" bgcolor="#666666">Department Points</td> <td style="border: 1px solid #000;" width="100" align="center" valign="middle" bgcolor="#666666">General Points</td> <td style="border: 1px solid #000;" width="100" align="center" valign="middle" bgcolor="#666666">Total Points</td> </tr> <?php do { ?> <tr> <td width="31" height="28" align="center" style="border: 1px solid #000;"><a href="../pdf.php?Jobid=<?php echo $row_Recordset1['Jobid']; ?>" target="_blank"><img src="../images/pdf.png" alt="PDF Export" width="16" height="16" border="0" /></a></td> <td width="31" style="border: 1px solid #000;" align="center"><a href="../view.php?Jobid=<?php echo $row_Recordset1['Jobid']; ?>" target="_blank"><img src="../images/preview.png" alt="Preview" width="16" height="16" border="0" /></a></td> <td width="31" style="border: 1px solid #000;" align="center"><a href="../update_form.php?Jobid=<?php echo $row_Recordset1['Jobid']; ?>" target="_blank"><img src="../images/Edit.png" alt="Edit" width="16" height="16" border="0" /></a></td> <td style="border: 1px solid #000;" align="right"><?php echo $row_Recordset1['Jobid']; ?> </td> <td style="border: 1px solid #000;" align="right"><?php echo $row_Recordset1['Market']; ?> </td> <td style="border: 1px solid #000;" align="right"><?php echo $row_Recordset1['General_10']; ?> </td> <td style="border: 1px solid #000;" align="right"><?php echo $row_Recordset1['Entry_Points']; ?> </td> <td style="border: 1px solid #000;" align="right"><?php echo $row_Recordset1['Dept_Points']; ?> </td> <td style="border: 1px solid #000;" align="right"><?php echo $row_Recordset1['General_Points']; ?> </td> <td style="border: 1px solid #000;" align="right"><?php echo $row_Recordset1['Total_Points']; ?> </td> </tr> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?> <table border="0" align="center" width="270px"> <tr> <td width="30px" valign="middle"><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?> <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, 0, $queryString_Recordset1); ?>"><img src="../images/first.png" alt="First" width="16" height="16" alt="First Page" /> </a> <?php } // Show if not first page ?></td> <td width="30px" valign="middle"><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?> <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, max(0, $pageNum_Recordset1 - 1), $queryString_Recordset1); ?>"><img src="../images/previous.png" alt="Previous Page" width="16" height="16" alt="previous" /> </a> <?php } // Show if not first page ?></td> <td width="150px" style="font-family:'Segoe UI'; font-size:12px; color:#333; font-weight:700; line-height:40px;"> Records <?php echo ($startRow_Recordset1 + 1) ?> to <?php echo min($startRow_Recordset1 + $maxRows_Recordset1, $totalRows_Recordset1) ?> of <?php echo $totalRows_Recordset1 ?></td> <td width="30px" valign="middle"><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?> <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1); ?>"><img src="../images/Next.png" width="16" height="16" alt="Next" /> </a> <?php } // Show if not last page ?></td> <td width="30px" valign="middle"><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?> <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, $totalPages_Recordset1, $queryString_Recordset1); ?>"><img src="../images/Last.png" alt="Last Page" width="16" height="16" alt="Last" /> </a> <?php } // Show if not last page ?></td> </tr> </table> </table> </div> <div id="dash3_grid_bot"></div> </div><br /> <br /> <br /> </td> </tr> </table> <div id="dashboard"> </div> </div> <div class="dock" id="dock2"> <div class="dock-container2"> <a class="dock-item2" href="client.php"><span>Dashboard</span><img src="../Menu/images/Dashboard-.png" alt="home" /></a> <a class="dock-item2" href="brakedown.php"><span>Brakedown Report</span><img src="../Menu/images/brakedown.png" alt="contact" /></a> <a class="dock-item2" href="Compliance.php"><span>Compliance Report</span><img src="../Menu/images/compliance.png" alt="portfolio" /></a> <a class="dock-item2" href="jobstatus.php"><span>Job Status Report</span><img src="../Menu/images/jobstatus.png" alt="music" /></a> <a class="dock-item2" href="reports.php"><span>Reports</span><img src="../Menu/images/charts.png" alt="video" /></a> <a class="dock-item2" href="#"><span>Logout</span><img src="../Menu/images/off.png" alt="history" /></a> </div> </div> <!--Menu End--> </div> <!--Wrapper End--> <!--dock menu JS options --> <script type="text/javascript"> $(document).ready( function() { $('#dock2').Fisheye( { maxWidth: 60, items: 'a', itemsText: 'span', container: '.dock-container2', itemWidth: 40, proximity: 80, alignment : 'left', valign: 'bottom', halign : 'center' } ) } ); </script> </body> </html> <?php mysql_free_result($Recordset1); mysql_free_result($status); ?> Please Help me guys Hi, I have db table that records the days (Sunday, Monday...) when the employee login to the system. Say that the employee logged in on Monday then Logged in on Wednesday so this means he was absent on Tuesday. I calculated the number of days to get the answer 2 (between Wednesday and Monday before logging in on Wednesday) how to get the name of the missing day "Tuesday"? code: $curdate = date("Y-m-d"); $currday = date('l'); $lastdate = $row['indate']; $lastdayin = $row['lastdayin']; if ($lastdate !=Null) { $misseddates = strtotime($curdate) - strtotime($lastdate); $misseddates = $misseddates / 86400; echo $misseddates; $misseddays = strtotime($lastdayin) - strtotime($currday); $misseddays = $misseddays / 86400; echo $misseddays; } I tried to get the name of day in the last step but it only calculates 5 in numbers how to get the name. I want the answer to be "Tuesday" as of the example. Thanks. |