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

  • Home
  • SEARCH
  • 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 6890479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:17:13+00:00 2026-05-27T06:17:13+00:00

I’m having tough time connecting flex to MySql through zend php. I saw a

  • 0

I’m having tough time connecting flex to MySql through zend php. I saw a couple of examples using HTTP service. My question is as follows

1) I’m doing a simple insert and update only, just three tables. So should i use all those Zend AMF to achieve this?
2) Else what about using HTTPService?

The display was easiest operation using zend AMF, but when i tried inserting values, i was lost.

I’d a php file vo.php to store database field variables, but i could not use require_once function in main php file

This is vo.php

    class vo {

        public $id;
        public $username;
        public $symptom;
        public $number_of_times_tested;
        public $original_image;
        public $sequence_of_actions;
        public $customized_image;
        public $percieved_image;
    }

this is patientService file

//require_once 'vo.php';

class patientService { 
  var $username = "root"; 
  var $password = ""; 
  var $server = "localhost"; 
  var $port = "3306"; 
  var $databasename = "patient"; 
  var $tablename = "records"; 

  var $connection; 
  public function __construct() { 
    $this->connection = mysqli_connect( 
                       $this->server,  
                       $this->username,  
                       $this->password, 
                       $this->databasename, 
                       $this->port); 

    $this->throwExceptionOnError($this->connection); 
  } 

  public function getpatient() {
     $stmt = mysqli_prepare($this->connection,
          "SELECT
              records.id,
              records.username,
              records.symptom,
              records.number_of_times_tested,
              records.original_image,
              records.sequence_of_actions,
              records.customized_image,
              records.percieved_image
            FROM records");     

      $this->throwExceptionOnError();

      mysqli_stmt_execute($stmt);
      $this->throwExceptionOnError();

      $rows = array();
      mysqli_stmt_bind_result($stmt, $row->id, $row->username,
                    $row->symptom, $row->number_of_times_tested, $row->original_image,  $row->sequence_of_actions, $row->customized_image, $row->percieved_image
                    );

      while (mysqli_stmt_fetch($stmt)) {
          $rows[] = $row;
          $row = new stdClass();
          mysqli_stmt_bind_result($stmt, $row->id, $row->username,
                    $row->symptom, $row->number_of_times_tested, $row->original_image,  $row->sequence_of_actions, $row->customized_image, $row->percieved_image
                    );

      }

      mysqli_stmt_free_result($stmt);
      mysqli_close($this->connection);

      return $rows;
  }  
/* create a entry for database patient 
*/
    public function createPatient($item) {
    $stmt = mysqli_prepare($this->connection,
        "INSERT INTO patient (
            id,username,symptom,number_of_times_tested,original_image,sequence_of_actions,  
            customized_image,percieved_image) 
        VALUES (?, ?, ?, ?, ?, ?, ?, ?)");
    $this->throwExceptionOnError();


    mysqli_bind_param($stmt, $item->id , $item->username, $item->symptom,$item->number_of_times_tested,$item->original_image,
        $item->sequence_of_actions, $item->customized_image, $item->percieved_image
    );

    $item->id = '5';
    $item->username = 'abhilash';
    $item->symptom = 'retina pigmentosa'; 
    $item->number_of_times_tested = '3';
    $item->original_image = 'img';
    $item->sequence_of_actions = 'l1l2l2lr3';
    $item->customized_image = 'img';
    $item->percieved_image = 'img';

    $this->throwExceptionOnError();



    mysqli_stmt_execute($stmt);
    $this->throwExceptionOnError();


    $autoid = mysqli_stmt_insert_id($stmt);


    mysqli_stmt_free_result($stmt);
    mysqli_close($this->connection);

    return $autoid;
  }

Can anyone give a link to good detailed example? So i can refer and understand better?

  • 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-05-27T06:17:14+00:00Added an answer on May 27, 2026 at 6:17 am

    HTTPService is here to be used to request any kind of HTTP ressource inside of Flex. If you want you can design your own JSon or XML based webservice that will do the needed operation on your table. This strategy front end independent, if you choose to switch front-end techno, from Flex to HTML/Ajax, for instance you won’t have to do any change on your backend.

    The other solution is to use Zend_AMF to enable direct interaction with your PHP object from Flex through AMF.

    I’ve always prefered to use the first solution (with no more interesting reasons than I better understood what I do), but the second one should give you some productivity gain if you plan do to a flex only front end.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.