RE: [PHP-DB] Quarter question..
| From: | joakim dot andersson at cybercom dot se | Date: | Mon, 04 Nov 2002 11:58:26 +0000 |
| Subject: | RE: [PHP-DB] Quarter question.. | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-22963@lists.php.net to get a copy of this message | ||
> $sql = "select quarter($qdate)" or die("not work #3");
change to
$sql = "select quarter($qdate) as my_quarter"; //Added an alias to
quarter($qdate). Easier to access that way...
And there's no need for an 'or die()' here. You're just assigning a variable
and most likely this will allways work!
> $yyy = mysql_query ($sql) or die("not work #4");
change to
$yyy = mysql_query ($sql) or die("not work #4: " . mysql_error());
//Standard MySQL trouble-shooting...
> printf("<td><a
> href=\"%s?id=%s&delete=yes\">Delete</a></td>",
> $PHP_SELF,
> $myrow["id"]);
> printf("<td><a
>
> href=\"%s?id=%s&submit=yes\">Update</td><td>%s</td><td>
> %s</td><td> %s</td></a></tr>",
> "update-inv.php", $myrow["id"], $myrow["name"],
> $myrow["details"], $yyy);
and here you actually echo out the resource id instead of it's value...
change $yyy to $yyy["my_quarter"]
HTH
Joakim