Jump to content

SurvivorZ

Members
  • Posts

    5
  • Joined

  • Last visited

SurvivorZ's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. http://www.askapache.com/php/sending-post-form-data-php-curl.html demonstrates how to submit POST forms via PHP and curl.
  2. I am positive that what you want is a Factory instead of the Singleton. But really, what you want to research is called Constructor-based Dependency Injection.
  3. You should use include to fetch files from your web server's file system. NOT URLs.
  4. It is, largely, bullshit. Consider: class Foo { private $bar; public function getBar() { return $this->bar; } public function setBar($bar) { $this->bar = $bar; } } is equivalent to class Foo { public $bar; } Encapsulation has to do with hiding the implementation details from the end-developer. Poorly encapsulated classes ask, then do. Well encapsulated classes don't ask, but get told what to do. Check out this Car class for an example of a very well encapsulated example. You see code like: $car = CarFactory::loadCar($_GET['car']); $car->turnOn(); $car->drive(60, 0.0); As a rule of thumb, well encapsulated code **rarely** needs to be queried to figure out what to do. It already has most logic paths already mapped out as public methods.
  5. Hi. mysql_ functions are deprecated and will be removed relatively soon. Convert to PDO instead: $pdo = new PDO("mysql:host=localhost;dbname=$dabaseName", $dbUsername, $dbPassword); $sql = <<<SQL SELECT member.id_member, member.nama_depan, pemesanan.nama_menu, pemesanan.tanggal, pemesanan.jam, pemesanan.harga FROM menu, pemesanan, member WHERE menu.id_menu = pemesanan.id_menu AND member.id_member = pemesanan.id_member ORDER BY pemesanan.jam SQL; $stmt = $pdo->prepare($sql); $stmt->execute(); while($datapesan = $stmt->fetch()) { print_r ($datapesan); }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.