Jump to content

Marrvel

Members
  • Posts

    6
  • Joined

  • Last visited

    Never

About Marrvel

  • Birthday 11/13/1982

Contact Methods

  • MSN
    rmarrvle@hotmail.com
  • Website URL
    http://www.2creation.com

Profile Information

  • Gender
    Not Telling
  • Location
    London

Marrvel's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello everybody, I'm working on a credit card validation but that's not important. While looking at some other peoples scripts for inspiration I found on with this syntax in the function declaration: [code] checkCreditCard ($cardnumber, $cardname, &$errornumber, &$errortext)[/code] all i want to know is why  are there &'s in front of the last 2 variables? what does it do? I've never seen it used before. Cheers Rob
  2. Thanks very much Barand, That works a treat.
  3. Hi everyone, Haven't been around here lately but i'm stuck on a problem so I've come crawling back. I'm trying to write a script that get's all the mondays between 2 dates starting from the monday of the current week, heres my code so far: [code] <?php $today = date('w'); $max_date = "2006-12-31"; $max_day = date('w',strtotime($max_date." 01:01:01")); /* this gets the start date by going back to the nearest monday from today*/ if($today <> 1) { $days_from_mon = ($today == 0) ? 6 : $today -1; $first_monday = date('Y-m-d',strtotime("-".$days_from_mon." days")); } else $first_monday = date('Y-m-d'); /* this gets the last monday by going back to the nearest monday from the max date */ if($max_day  <> 1) { $days_from_mon = ($max_day  == 0) ? 6 : $max_day  -1; $last_monday = strtotime($max_date) - (86400 * $days_from_mon); } else $last_monday = $max_date; echo $first_monday." - ".date('Y-m-d',$last_monday)."<br>"; /* this loops though weeks until it meets the max date*/ for($i=0;$week_start <> $last_monday;$i++) { $week_start = strtotime($first_monday) + (604800 * $i); #this adds $i number of weeks to the original week echo date('Y-m-d',$week_start)."<br />"; } ?> [/code] This script seems to work fine until it gets to the end of October then for some reason it goes to a sunday which sends it into a infinite loop. I just can't figure out why this happens Thanks in advance Rob
  4. Marrvel

    Joins etc..

    try this: SELECT `t`.`subject`, `r`.`reply`, `r`.`when` as `replied_date` FROM `tickets_replies` as `r` INNER JOIN `tickets` as `t` ON `t`.`id`=`r`.`ticket_id` WHERE `t`.`id`='$id' AND ORDER BY `r`.`when`
  5. Thanks for that, no problem running another query, just wondered if there was an alternate function
  6. Does anyone know if theres is an equivalent to the mysql_insert_id() function in mssql or am i going to have to run another query to get the last insert id?
×
×
  • 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.