Jump to content

MrLarkins.com

Members
  • Posts

    20
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

MrLarkins.com's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I pulled a date from mysql and this is what i get "1072806465" what kind of formatting is that?  and how to i make it like 3-January 2003  or whatever the actual date is?
  2. lol, i'm such a bonehead sometimes...its all good, thanks for the help, this topic is done...
  3. hmm, i don't see where it is...you look...[code]<?php //---------------------------- // Require //---------------------------- require "forums/conf_global.php"; //because this file will not be located in the forums directory. //------------------------------- // Connect To MySQL //------------------------------- mysql_connect($INFO['sql_host'], $INFO['sql_user'], $INFO['sql_pass']) or die(mysql_error()); mysql_select_db($INFO['sql_database']) or die(mysql_error()); $define_country = array("u"=>"United States","e"=>"England","c"=>"Canada","m"=>"Mexico","a"=>"Aruba","o"=>"Other"); $define_state = array("AL"=>"Alabama","AK"=>"Alaska","AZ"=>"Arizona","AR"=>"Arkansas","CA"=>"California","CO"=>"Colorado","CT"=>"Connecticut","DE"=>"Delaware","DC"=>"District of Columbia","FL"=>"Florida","GA"=>"Georgia","HI"=>"Hawaii","ID"=>"Idaho","IL"=>"Illinois","IN"=>"Indiana","IA"=>"Iowa","KS"=>"Kansas","KY"=>"Kentucky","LA"=>"Louisiana","ME"=>"Maine","MH"=>"Marshall Islands","MD"=>"Maryland","MA"=>"Massachusetts","MI"=>"Michigan","MN"=>"Minnesota","MS"=>"Mississippi","MO"=>"Missouri","MT"=>"Montana","NE"=>"Nebraska","NV"=>"Nevada","NH"=>"New Hampshire","NJ"=>"New Jersey","NM"=>"New Mexico","NY"=>"New York","NC"=>"North Carolina","ND"=>"North Dakota","MP"=>"Northern Mariana Islands","OH"=>"Ohio","OK"=>"Oklahoma","OR"=>"Oregon","PA"=>"Pennsylvania","PR"=>"Puerto Rico","RI"=>"Rhode Island","SC"=>"South Carolina","SD"=>"South Dakota","TN"=>"Tennessee","TX"=>"Texas","UT"=>"Utah","VT"=>"Vermont","VI"=>"Virgin Islands","VA"=>"Virginia","WA"=>"Washington","WV"=>"West Virginia","WI"=>"Wisconsin","WY"=>"Wyoming","AB"=>"Alberta","BC"=>"British Columbia","MB"=>"Manitoba","NB"=>"New Brunswick","NL"=>"Newfoundland and Labrador","NT"=>"Northwest Territories","NS"=>"Nova Scotia","NU"=>"Nunavut","ON"=>"Ontario","PE"=>"Prince Edward Island","QC"=>"Quebec","SK"=>"Saskatchewan","YT"=>"Yukon","OO"=>"Other"); $define_character = array("m"=>"Medic","g"=>"Gunner","r"=>"Rifleman","s"=>"Sniper","e"=>"Engineer"); //Start HTML Table print('<table cellspacing=0 cellpadding=0 width=100%>'); //----------------------------------- //Get Info //----------------------------------- $main_result = mysql_query("SELECT m.id, m.name, m.email, m.joined, m.bday_day, m.bday_month,     m.bday_year, x.icq_number, c.field_1, c.field_2, c.field_3, c.field_4 FROM ibf_members AS m INNER JOIN ibf_member_extra AS x ON m.id = x.id INNER JOIN ibf_pfields_content AS c ON m.id = c.member_id WHERE mgroup=7 ORDER BY id"); while($main = mysql_fetch_array($main_result)) { //while you have records available from the SELECT query     $id = $main['id'];     $name = $main['name'];     $email = $main['email'];     $join_date = $main['joined'];     $bday_day = $main['bday_day'];          $bday_month = $main['bday_month'];     $bday_year = $main['bday_year'];        $icq = $main['icq_number'];     $stats = $main['field_1'];     $character = $main['field_2'];     $country = $main['field_3'];     $state = $main['field_4']; function getAge ($bday, $bmon, $byr) {     $ynow = date('Y');         $age = $ynow - $byr;         // format birth month and day as "0901"     $bmd = sprintf ('%02d%02d', $bmon, $bday);         // format today monthand day in same way     $mdnow = date('md');         if ($bmd > $mdnow) $age -= 1;  // sub 1 from age if not there yet         return $age; } // call the function to get the age $age = getAge ($bday_day, $bday_month, $bday_year); echo $age; echo ("<tr><td>$name </td><td>JOINED $join_date</td><td><img src='images/flags/$define_country[$country].gif' border=1 alt='$define_country[$country]'> <img src='images/flags/$define_state[$state].gif' border=1 alt='$define_state[$state]'></td><td><a href='http://web.icq.com/whitepages/add_me?uin=$icq_number&action=add'><font size='-1'>$icq_number</font></a></td><td><a href='mailto:$email'><font size='-1'>Email</font></a></td><td>AGE $age</td><td><a href='$stats'><font size=-1><b><u>JO Stats</u></b></a></td><td>$define_character[$character]</td></tr>"); } //Finish the HTML table print('</table>'); ?>[/code]
  4. ok, so why do i get the error? [url=http://www.ice-squad.com/Memberslist.php]http://www.ice-squad.com/Memberslist.php[/url] <--see here
  5. hmm, barand, should i modify the function getAge ([b]$bday, $bmon, $byr[/b]) to show bday_day,bday_month,bday_year?  i copied and pasted it straight into place and it gave me an error on that line
  6. lol, Barand my response was to the other guy, you posted while i was typing,lol
  7. hey, that looks like a winner.  but it leaves me with two new problems 1]  my birthday data is from seperate columns in the database.  how would i merge them to make it the necessary formatting for your code? 2]  my birthday data is of the form YYYY for year, M for month, and D for day, when it needs to be (YYYY-MM-DD). i.e.  the 1st shows as '1' not '01' and August shows as '8' not '08'.  would i use a push to add the preceeding zeros? 
  8. yea, i saw that, but it finds the age if you input a specific date, not exactly what i'm need/wanting. but i would use a function right?  i know diddly-squat about those.
  9. ok, i $bday_day //birthday day $bday_month //birthday month $bday_year //birthday year $today = getdate(); previously defined from a mysql grab i've done (the birthday stuff is in the database in columns bday_day, bday_month, bday_year) what i'd like to do is use this data to find out how old the person is and display it
  10. ok, i think i know the answer here if pull data from several different tables and join them by a common item, say member id, what happens when a member id doesn't have data in the second table?
  11. ah, i see what he was trying to ask...good job tleisher!
  12. is the url a variable? or just the clickable text?
  13. hey, that works great...EXCEPT: there are five members of mgroup=4, but only the last 3 show up... [url=http://www.ice-squad.com/Commandlist.php]http://www.ice-squad.com/Commandlist.php[/url]
  14. hmm, need more info, but i'll try a blind answer [code]echo ("<a href='$link'>$link</a>");[/code]
×
×
  • 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.