Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8820277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:34:10+00:00 2026-06-14T05:34:10+00:00

I am relatively new to PHP and having some decent success however I am

  • 0

I am relatively new to PHP and having some decent success however I am running into this issue:

If I try to create a new instance of the class GenericEntryVO, I get a 500 error with little to no helpful error information. However, if I use a generic object as the result, I get no errors. I’d like to be able to cast this object as a GenericEntryVO as I am using AMFPHP to communicate serialize data with a Flex client.

I’ve read a few different ways to create constructors in PHP but the typical ‘public function Foo()’ for a class Foo was recommended for PHP 5.4.4

//in my EntryService.php class
public function getEntryByID($id)
{
    $link = mysqli_connect("localhost", "root", "root", "BabyTrackingAppDB");

    if (mysqli_connect_errno())
    {
        printf("Connect failed: %s\n", mysqli_connect_error());
        exit();
    }

    $query = "SELECT * FROM Entries WHERE id = '$id' LIMIT 1";

    if ($result = mysqli_query($link, $query))
    {
        // $entry = new GenericEntryVO(); this is where the problem lies!

        while ($row = mysqli_fetch_row($result))
        {
            $entry->id = $row[0];
            $entry->entryType = $row[1];
            $entry->title = $row[2];
            $entry->description = $row[3];
            $entry->value = $row[4];
            $entry->created = $row[5];
            $entry->updated = $row[6];
        }
    }

    mysqli_free_result($result);
    mysqli_close($link);

    return $entry;
}

//my GenericEntryVO.php class 
<?php

class GenericEntryVO
{
    public function __construct()
    {
    }

    public $id; 
    public $title;
    public $entryType;
    public $description;
    public $value;


    public $created;
    public $updated;

    // public $properties;
}

?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T05:34:12+00:00Added an answer on June 14, 2026 at 5:34 am

    Thanks again for the lead @eis. I didn’t realize that you could access an error log in PHP. Being an as3/Flex developer, I am used to using a debugger with breakpoints. Not sure if PHP dev’rs have a similar IDE like Flash Builder.

    After seeing that the generic 500 error was an issue with finding the right class to instantiate I did some investigating on my own. I needed to put require_once realpath(dirname(FILE).’/vo/GenericEntryVO.php’); at the top of the class. I was using as3 syntax and expecting the file path to be relative to the current file being processed. Here is where I found this solution:

    How do I format a PHP include() absolute (rather than relative) path? It’s about the 4th or 5th comment down by a person named @Zoredache

    I am not sure if this is the best solution, but it has me up and running again with my data objects getting serialized for consumption in Flex.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This may be a silly question, but as someone relatively new to PHP, I'm
I'm relatively new to PHP. I'm wondering if it's possible to simply create a
I am relatively new to PHP/MySQL and have been having a problem that I
I'm relatively new to php / mysqli i'm having trouble authenticating the user, I'm
I'm relatively new to php development but not to web development in general. I
i am relatively new to php and i've encountered a very strange problem. let
I am relatively new to PHP, but experienced Java programmer in complex enterprise environments
Note: I'm relatively new to Objective-C and am coming from Java and PHP. Could
I am relatively new to php and have a feeling that I am going
i'm relatively new to php and mysql and would like to know how to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.