Sorry, line 51 is the one that reads:
                $1contentID=$row["1contentID"];


> -----Original Message-----
> From: Hutchins, Richard [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 26, 2002 4:19 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Return Array from Function
> 
> 
> Can somebody tell me what I might be doing wrong in the code 
> below? I'm
> trying to use a function to perform an often-used db query 
> and return the
> resulting resource to the calling script. I keep getting this 
> error though:
> 
> Parse error: parse error, unexpected T_LNUMBER, expecting 
> T_VARIABLE or '$'
> in c:\spidey\public\addleveltwo.php on line 51
> 
> I've looked and looked, but I can't find what could be causing a parse
> error. Most likely, I've just been looking at it for too 
> long. Any fresh
> eyes available?
> 
> <?php
>       include("../protected/getContent.php");
> 
>       getLevelOnes($docnum); //user-defined function from 
> included file.
> Definition appears after this snippet.
>       
>       $num=mysql_num_rows($levelones);
> 
>       if($num<1)
>       {
>               echo("There is no level one (Section) content for this
> document in the database.");
>               exit();
>       }
> 
>       while($row=mysql_fetch_array($levelones))
>       {
>               $1contentID=$row["1contentID"];
>               $parentID=$row["parentID"];
>               $1child=$row["childID"];
>               $1content=$row["1content"];
>               $1ordinal=$row["ordinal"];
> 
>               echo("<tr><td>".$1content."</td><td><a
> href=\"contentMgr.php?docnum=".$docnum."\"
> target=\"_right\">Add</a></td></tr>");
>       }
> ?>
> 
> <?php
> function getLevelOnes($docnum)
> {
>       $sql="SELECT 1contentID, parentID, childID, 1content, 
> 1ordinal FROM
> levelone WHERE 1contentID='$docnum'";
>       $levelones=mysql_query($sql)
>               or die(mysql_error());
>       return $levelones;
> }
> ?>
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to