Re: non-db selections in mysql, php

From: Date: Sun, 09 Jul 2000 15:00:23 +0000
Subject: Re: non-db selections in mysql, php
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-991@lists.php.net to get a copy of this message
e.g. the mysql statement "select weekday(20000704010101) is a valid query in MySQL... but how did I read this statement in conjunction with PHP to read the result?
Use the "as" of SQL to assign the result to a name which can be referenced like in this snippet: <?php
        $q="SELECT weekday(200007040101011) as weekday";
        $r=mysql("mysql",$q);
        $row=mysql_fetch_object($r);
        print "weekday : $row->weekday<br>";
?> Grtz -- Paul Jongsma WEBtic Internet Consultancy @ http://www.webtic.nl/

« previous php.db (#991) next »