Ben Whitesell wrote:

I'm trying to use the week() or weekofyear() functions in a php script.
Here's a clipping of the code:

           $sql = "SELECT WEEK('2004/06/01')";
           echo $sql; //used for checking purposes
           $week = mysql_query($sql, $link);//where $link is in an inc file
linking that file to this page
           echo $week;


You are echo'ing the compleet Recordset. that is why you get the value of

Resource id #3
You can try the following:


$sql = "SELECT WEEK('2004/06/01') AS weeknummer";
$recordset = mysql_query($sql, $link);
$week = mysql_result($recordset, 0, 'weeknummer');

Alexander Croes
 --
http://www.viganed.com


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to