Jump to content

proctk

Members
  • Posts

    300
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

proctk's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. The problem is the date value in the mysql tabel. I need to somehow use mysql to change the date from 1978-03-11 to 2008-03-11. any ideas how to change the year
  2. HI I have then below that is supposed to return a reformated date from a field in a mysql date field in my table. users.spousedob = 1978-03-11 DATE_FORMAT(users.spousedob, '%a %b %e') The is returning Saturday, March 11 2008 but should be returning Tuesday, March 11 2008 Any ideas how to fix this Thank you
  3. here is the complete code for the page <?php /* Check User Script */ session_start(); // Start Session include ("../Connections/db.php"); //check if user is already logged in if (!isset($_SESSION['user_id'])){ $msg = 'You tryed to access a members only page. Login or become a registered member to access that page!'; header("Location: ../index.php?msg=".$msg); } //Checks if the profile request is for a new login or someone requesting if(isset($_GET['id'])){ $id = $_GET['id']; }else{ $id = $_SESSION['user_id']; } ?> <!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"><!-- InstanceBegin template="/Templates/twoCoumn.dwt.php" codeOutsideHTMLIsLocked="false" --> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <!-- InstanceBeginEditable name="doctitle" --> <title>Family Click|Album Photos</title> <!-- InstanceEndEditable --> <link rel="stylesheet" href="../design/tabbler.css" type="text/css" media="screen" /> <link rel="stylesheet" href="../design/tabbler-print.css" type="text/css" media="print" /> <link rel="stylesheet" type="text/css" href="../design/layout.css" /> <link rel="stylesheet" type="text/css" href="../design/design.css" /> <script type="text/javascript" src="../design/tabber.js"></script> <!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable --> </head> <body> <div id="outer"> <div id="hdr"> <div id="logo-div"> <h2 id="logo"><a href="../index.php">Family Click</a></h2> <h4 id="slogan-text">Keeping Families Connected</h4> </div> <div class="headerText"> <h5> </h5> </div> </div> <div style="clear:left"></div> <div id="bar"><!-- InstanceBeginEditable name="Bar" --><?php include('../design/bar.php'); ?><!-- InstanceEndEditable --></div> <div id="bodyblock" align="right"> <div id="l-col" align="left"><!-- InstanceBeginEditable name="Left Column" --><?php include('../searchMembers.php'); ?><!-- InstanceEndEditable --></div> <div id="cont"><!-- InstanceBeginEditable name="Body Content" --> <?php $msg = (isset($_GET['msg']) AND $_GET['msg']<> "") ? urldecode($_GET['msg']) : ''; if ($msg <> "") { if (get_magic_quotes_gpc()) { $msg = stripslashes($msg); } echo "<div id='alertMessage'><p style='margin-left:40px;'>$msg</p></div>"; } // Get buddies $query_get_buddy = ("SELECT * from buddylink WHERE owner_id = '$id' AND status = '2'"); $get_buddy = mysql_query($query_get_buddy)or die("SQL Error: $query_get_buddy<br>" . mysql_error()); while ($buddy = mysql_fetch_assoc($get_buddy)){ $buddy_id = $buddy['buddy_id']; //Get buddy information $query_get_buddy_info = ("SELECT * FROM users WHERE user_id = '$buddy_id'"); $get_buddy_info = mysql_query($query_get_buddy_info)or die("SQL Error: $query_get_buddy_info<br>" . mysql_error()); while($buddy_info = mysql_fetch_assoc($get_buddy_info)){ //Get Buddies Albums $query_buddy_albums = ("SELECT * FROM albumNames WHERE user_id = '$buddy_id'"); $buddy_album = mysql_query($query_buddy_albums)or die("SQL Error: $query_buddy_albums<br>" . mysql_error()); $i = 0; while($album = mysql_fetch_assoc($buddy_album)){ $image = "../user_images/".$album['album_cover']; $tempimg = getImageSize($image); $size = $tempimg[3]; $size = explode("\"",$size); $width = $size[1]; $height = $size[3]; $newwidth=75; $newheight=($height/$width)*75; ////////// $col = ($i % 2) ? 'right' : 'left'; echo "<div class=\"$col\">";?> <table class="table" style="width:99%;"> <tr> <td rowspan="3" style="width:20%;" valign="top"> <a href="albumPhotos.php?photos=<?php echo $album['album'];?>&bid=<?php echo $buddy_id; ?>"><img src="../user_images/<?php echo $album['album_cover']; ?>" width="<?php echo $newwidth; ?>" height="<?php echo $newheight; ?>" alt="<?php echo $album['album_cover']; ?>" /></a> </td> <td style="width:30%;" class="eventSub">Album:</td> <td valign="top"><?php echo $album['album']; ?></td> </tr> <tr> <td style="width:25%;" class="eventSub">Owner:</td> <td><a title="Go to members profile" class="linkText" href="../profile.php?=id=<?php echo $album['user_id']; ?>"><?php echo $buddy_info['first_name'].' '.$buddy_info['last_name'];?></a></td> </tr> <tr> <td style="width:25%;" class="eventSub">Created:</td> <td><?php echo $album['createdate']; ?></td> </tr> </table> <? echo "</div>"; $i++; } ?> <?php } }?> <div class="contentBottomSpace"></div> <!-- InstanceEndEditable --></div> </div> <div id="ftr"><!-- InstanceBeginEditable name="Footer" --><?php include('../design/ftr.php'); ?> <!-- InstanceEndEditable --></div> </div> </body> <!-- InstanceEnd --></html>
  4. Hi The below code is supposed to display tables side by side so to per row, It's kind of working until it gets to the last entry. In my sample query The divs are 1. left 2. right 3.left 4. left nuber 4 should be right. Any ideas why its not working $i = 0 $col = ($i % 2) ? 'right' : 'left'; echo "<div class=\"$col\">";?> <table class="table" style="width:99%;"> <tr> <td rowspan="3" style="width:20%;" valign="top"> <a href="albumPhotos.php?photos=<?php echo $album['album'];?>&bid=<?php echo $buddy_id; ?>"><img src="../user_images/<?php echo $album['album_cover']; ?>" width="<?php echo $newwidth; ?>" height="<?php echo $newheight; ?>" alt="<?php echo $album['album_cover']; ?>" /></a> </td> <td style="width:30%;" class="eventSub">Album:</td> <td valign="top"><?php echo $album['album']; ?></td> </tr> <tr> <td style="width:25%;" class="eventSub">Owner:</td> <td><a title="Go to members profile" class="linkText" href="../profile.php?=id=<?php echo $album['user_id']; ?>"><?php echo $buddy_info['first_name'].' '.$buddy_info['last_name'];?></a></td> </tr> <tr> <td style="width:25%;" class="eventSub">Created:</td> <td><?php echo $album['createdate']; ?></td> </tr> </table> <? echo "</div>"; $i++; } ?> <?php } }?>
  5. Hi I need script that will convert a number say 03 to the month name in this case March. Thank you
  6. The last post worked, thank you for all the help
  7. how would I work that in
  8. I tested this code and it does not work it returns Wednesday, December 31 1969
  9. thank you for the post however I think there is a small glitch in the code 2008-03-11 returns March 03 2008 any idea why
  10. Hi I have a date value assigned to a variable $date which is in this format 2008-03-05. How would I use php to reorganize the date so that is reads Wednesday, March 05 2008 Thank you
  11. I figured out this much. Its returning the entries that I want but it including the entrys that the month is not found also, Its giving me the blank record. I found a fix by using an if statement however I never had a query do this before any thoughts
  12. Hi I have a query that is returning the correct information however its adding in blank rows, I reviewed my tables to see if there were records that would cause this. I'm lookig to have somthing returned to help me determine why there are extra recoreds returned. here is my code $sqlbuddy = " SELECT buddylink.owner_id, buddylink.buddy_id, users.first_name, users.last_name, users.DOB FROM buddylink LEFT JOIN users ON buddylink.buddy_id = users.user_id ".$qryUserDate ." WHERE buddylink.owner_id = $id". $exString; echo $sqlbuddy; $qrybuddy = mysql_query($sqlbuddy)or die("SQL Error: $sqlbuddy<br>" . mysql_error()); $sqlBuddy returns SELECT buddylink.owner_id, buddylink.buddy_id, users.first_name, users.last_name, users.DOB FROM buddylink LEFT JOIN users ON buddylink.buddy_id = users.user_id AND (month(users.DOB) = 03) WHERE buddylink.owner_id = 63 AND buddylink.buddy_id <>4 AND buddylink.buddy_id <>5 AND buddylink.buddy_id <>7 AND buddylink.buddy_id <>13 AND buddylink.buddy_id <>26 AND buddylink.buddy_id <>178 When I call the result <?php while($rbuddy = mysql_fetch_assoc($qrybuddy)) : ?> <?php echo 'Yes'.$rbuddy['DOB']; ?><br/> <?php endwhile; ?> I get Yes Yes Yes1953-03-19 Yes1990-03-05 Yes Yes1966-03-15 The Yes with no date next to them should not be there any help is great
  13. thank you for the post and guidance it helped me solve my problem
  14. Hi below is a query That I'm trying to get all entry that have the matching month in a a date column (Yes the column is set to date format ). For some reason its returning all found entries but only for the table children. the query $qryDate = " AND (month(parent.parentdob) = $eventMonth) OR (month(children.childdob) = $eventMonth) OR (month(sibling.siblingdob) = $eventMonth) OR (month(users.spousedob) = $eventMonth) OR (month(users.DOB) = $eventMonth)"; // $sql = "SELECT users.first_name, users.last_name, children.childdob, children.childfirstname, children.childlastname, sibling.siblingdob, sibling.siblingfirstname, sibling.siblinglastname, parent.parentdob, parent.parentfirstname, parent.parentlastname, users.DOB, users.spousedob, users.spousefirstname, users.spouselastname FROM users LEFT JOIN children ON children.owner_id = users.user_id LEFT JOIN parent ON parent.owner_id = users.user_id LEFT JOIN sibling ON sibling.owner_id = users.user_id WHERE" .$newQryDate." AND users.user_id = '$id'"; out put see anything wrong thanks SELECT users.first_name, users.last_name, children.childdob, children.childfirstname, children.childlastname, sibling.siblingdob, sibling.siblingfirstname, sibling.siblinglastname, parent.parentdob, parent.parentfirstname, parent.parentlastname, users.DOB, users.spousedob, users.spousefirstname, users.spouselastname FROM users LEFT JOIN children ON children.owner_id = users.user_id LEFT JOIN parent ON parent.owner_id = users.user_id LEFT JOIN sibling ON sibling.owner_id = users.user_id WHERE (month(parent.parentdob) = 03) OR (month(children.childdob) = 03) OR (month(sibling.siblingdob) = 03) OR (month(users.spousedob) = 03) OR (month(users.DOB) = 03) AND users.user_id = '63'
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.