Re: Need Help resolving the "undefined variable" and "getting property of non-object" errors
| From: | Shawn McKenzie | Date: | Tue, 27 Jan 2009 18:43:44 +0000 |
| Subject: | Re: Need Help resolving the "undefined variable" and "getting property of non-object" errors | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-287231@lists.php.net to get a copy of this message | ||
Terion Miller wrote:
> Hello All,
> I am having problems resolving errors with some images causing the Undefined
> variable and getting property of non-object errors, I am trying to make a
> copy function so that an order can be viewed then resubmitted as a new order
> with minimal changes if needed.
> Here's my code: --could it be out of order as in the select should be above
> the insert? I bolded where the errors are happening.
> ---------------------------------------------------------------------------------------
>
> if ($GO == "Save") {
echo $AdminID;
> $sql = "SELECT Name FROM admin WHERE AdminID='$AdminID'";
> $result = mysql_query ($sql);
echo mysql_num_rows($result); //if 0 then $result is empty
> * $row = mysql_fetch_object($result); this is giving me problems and I
> tried changing the object to assoc
> *
> $Notes = "~". date("F j, Y g:i a") ." - Planet Discover Enhanced
> Listing
> Submitted by ". $row->Name ."\n"; *This is the "trying to get property
> of
> non object"*
>
--
Thanks!
-Shawn
http://www.spidean.com