Re: Using the AS key word in SQL Queries
| From: | Analysis & Solutions | Date: | Tue, 02 Jul 2002 05:57:48 +0000 |
| Subject: | Re: Using the AS key word in SQL Queries | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-104844@lists.php.net to get a copy of this message | ||
On Tue, Jul 02, 2002 at 11:08:13AM +0530, Sachin Keshavan wrote:
>
> I am trying to execute the Query
> SELECT MAX(RECORDNO) AS MAXREC FROM BOOKS;
>
> while($row = mysql_fetch_array($sql_result))
> {
> $bookID = $row['MAXREC'];
> }
>
> This query fails. Am I doing any thing wrong here.
Don't ask us. Ask MySQL. After running the query (I assume you ARE
running the query, via mysql_query(), right?) throw in an echo call to
mysql_error(). That'll tell you what went wrong:
http://www.php.net/manual/en/function.mysql-error.php
--Dan
--
PHP classes that make web design easier
SQL Solution | Layout Solution | Form Solution
sqlsolution.info | layoutsolution.info | formsolution.info
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409