Jump to content

Alexhoward

Members
  • Posts

    310
  • Joined

  • Last visited

    Never

About Alexhoward

  • Birthday 12/12/1983

Contact Methods

  • Website URL
    http://www.addsomemusic.co.uk

Profile Information

  • Gender
    Male
  • Location
    Norwich UK

Alexhoward's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Here's the answer. include("whatever.php"); mysql_connect($host, $db, $pass) or die ("Could not connect to mysql because ".mysql_error()); mysql_select_db($db) or die ("Could not select database because ".mysql_error()); $mysite_username = $HTTP_COOKIE_VARS["sitename"]; $year=mysql_query("SELECT dob FROM `profile` WHERE username = '$mysite_username'"); while($year1 = mysql_fetch_array($year)) $test = $year1['dob']; list($a, $v, $c) = explode('-',$test); echo $c yipee! i solved one
  2. it appears that it's not actually bringing anything back. yet if i do the same query in phpmyadmin, it works....?
  3. Hi Andy, because when i do that i get the errors as above... also, i have just been testing the code, and it appears that is does not work correctly...? Thanks for taking the time to look at this
  4. Hi Andy, Thanks for the reply I got it going like this, which i assume works, but now it's only single digits, e.g: 0 instead of 00 is there a way to make number_format double digits..? Thanks <?php $year=mysql_query("SELECT dob FROM $table WHERE username = '$mysite_username'"); while($year1 = mysql_fetch_array($year)) echo $year1['dob']; echo number_format(date($year1,"dd")); ?>
  5. Hi guys, back again so soon, sorry. but i'm getting an error code from this piece for script that i don't understand: Undefined offset: 2 and : Undefined offset: 1 am i not doing this correctly...? <?php include("whatever.php"); mysql_connect($host, $db, $pass) or die ("Could not connect to mysql because ".mysql_error()); mysql_select_db($db) or die ("Could not select database because ".mysql_error()); $mysite_username = $HTTP_COOKIE_VARS["sitename"]; $year=mysql_query("SELECT dob FROM $table WHERE username = '$mysite_username'"); while($year1 = mysql_fetch_array($year)) $year1['dob']; list ($y, $sm, $d) = explode ('-', $year1); echo number_format($d); ?> Thanks for all your help,
  6. Nice one! so if i just bang the php in there to grad a number from mysql, that's what it'll show! e.g. <option value="<?php ?>" selected="selected"><?php ?></option> however, this would put the number in twice...? for example php "selected", 1,2,3,4,... but i can live with that! cheers
  7. Hi guys, hoping someone here might have an idea about this one... I looked around the internet but can't find a soulution... Basically does anyone know how to set a default value to a select drop down box? Thanks in advance
×
×
  • 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.