1 person found this helpful
mysql_select_db(DB_NAME, $this->connection) or die(mysql_error());
Using die() is not recommended as you will see a "Channel Disconnected" message when something goes wrong. Die() stops the construction of a complete AMF response, hence this message.
I am by no means an expert; furthermore, I do not know PHP, I use ColdFusion. But what I am about to say applies just the same.
"however in the code generated like FB 4 it looks like this, I wanted to know what advantages this has over my method".
Advantages? None, and probably some disadvantages. I have qualms about this "data-centric" paradigm. Just to do some fun testing, I created two little projects:
Using the data-centric features of FB 4,
Resulting SWF size: 65 KB.
Using a service I coded, a cusom component based on mx:UIComponent,
Resulting SWF size: 54 KB.
These both have View Source enabled, so you can see the differences.
Anytime you use a program to generate code, that code will almost always be much larger than if you code by hand.
Look at the diference between the generated value objects and my single AS class. I have not run the profiler, so I don't know how many milliseconds' difference there is between how fast these run, but I suspect #2 is faster.
You can go from here.
Thanks for helping me out people
All the mysqli_prepare stuff looks more fancy and better than my methods, why would I want to do it that way?