Jump to content
php.lv forumi

php newbie

Reģistrētie lietotāji
  • Posts

    388
  • Joined

  • Last visited

Posts posted by php newbie

  1. uzkaras skripts un MySQL serveri nevar piestartēt:
     

    130224 13:11:28 [Note] Plugin 'FEDERATED' is disabled.
    InnoDB: The InnoDB memory heap is disabled
    InnoDB: Mutexes and rw_locks use Windows interlocked functions
    InnoDB: Compressed tables use zlib 1.2.3
    130224 13:11:28  InnoDB: Initializing buffer pool, size = 16.0M
    130224 13:11:28  InnoDB: Completed initialization of buffer pool
    130224 13:11:28  InnoDB: highest supported file format is Barracuda.
    InnoDB: The log sequence number in ibdata files does not match
    InnoDB: the log sequence number in the ib_logfiles!
    130224 13:11:28  InnoDB: Database was not shut down normally!
    InnoDB: Starting crash recovery.
    InnoDB: Reading tablespace information from the .ibd files...
    InnoDB: Restoring possible half-written data pages from the doublewrite
    InnoDB: buffer...
    InnoDB: Database page corruption on disk or a failed
    InnoDB: file read of page 245.
    InnoDB: You may have to recover from a backup.
    InnoDB: End of page dump
    130224 13:11:30  InnoDB: Page checksum 2870860906, prior-to-4.0.14-form checksum 372330996
    InnoDB: stored checksum 1529325762, prior-to-4.0.14-form stored checksum 372330996
    InnoDB: Page lsn 0 682665087, low 4 bytes of lsn at page end 682665087
    InnoDB: Page number (if stored to page already) 245,
    InnoDB: space id (if created with >= MySQL-4.1.1 and stored already) 0
    InnoDB: Page may be a system page
    InnoDB: Database page corruption on disk or a failed
    InnoDB: file read of page 245.
    InnoDB: You may have to recover from a backup.
    InnoDB: It is also possible that your operating
    InnoDB: system has corrupted its own file cache
    InnoDB: and rebooting your computer removes the
    InnoDB: error.
    InnoDB: If the corrupt page is an index page
    InnoDB: you can also try to fix the corruption
    InnoDB: by dumping, dropping, and reimporting
    InnoDB: the corrupt table. You can use CHECK
    InnoDB: TABLE to scan your table for corruption.
    InnoDB: See also http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html
    InnoDB: about forcing recovery.
    InnoDB: Ending processing because of a corrupt database page.

    

    sanāca piestartēt ar innodb_force_recovery = 5, kas nozīmē: Do not look at undo logs when starting the database: InnoDB treats even incomplete transactions as committed.

    Un kā izlabot?

  2. Nu nez man liekas tieši lielajos uzņēmumos ir vieglāk noturēties kad nav projektu. Jo ir citas nodaļas kuras varētu pelnīt. Esmu redzējis vienā lielā(Latvijas merogā) uzņēmumā viens sedēja bez darba pus gadu.

    mazajā kantorī nav projektu, nav naudas. un davaj uzredzēšanos

  3. Atkal labvakar!

     

    Tātad, it kā ar kategorijām tiku galā. Tagad seko lietotāju reģistrācija. Tagad tā jāpartaisa, jo ir jāinserto uzreiz 2 tabulās.

    Viena ir lietotāju (id, niks, epasts, parole) un otra ir lietotāju pieeju tabula (lietotāja id, grupas id). Ja jaunajam jūzerim nav zināms id, tad kā to ieinsertot otrā tabulā? Vai ir iespējams to sakombinēt ar joiniem?

    Joins nav vajadzīgs. Join izmanto datu izgūšanai 

     

    Vispār jau kohana ir Auth modulis http://kohanaframework.org/3.2/guide/api/Auth_ORM

     

    Ieslēdz to bootstrap.php

     

    Tad iekopē auth.php no modules\auth\config uz savu application\config un samaini File uz ORM lai lietotājus glabātu DB nevis failā

     

    'driver'       => 'File',

     

    tad izveido tabulas: http://docs.kohanaphp.com/addons/auth#database_schema_for_orm_driver 

     

    tad veido lietotāju un role apmēram tā:

    // izveido User modeļa objektu
    $user = new Model_User();
    
    // dabū post datus
    $post = $this->request->post();
    // padod tos datus modelim un izveido lietotāju
    $user->values($post)->save();
    
    // atrod role 'login'
    $loginRole = ORM::factory('Role')->where('name', '=', 'login')->find();
    // pieliek klāt 'login' role litotājam
    $user->add('roles', $loginRole);
    

    Logins logouts: http://kohanaframework.org/3.2/guide/auth/login

  4. Bet to visu izrēķināt lai varētu zināt kas notiks tālāk nav iespējams. Mēs pat nevaram izrēķināt visas šahu kombinācijas. Tāpēc man gribētos uzskatīt ka tas tomēr ir randoms

    Man vairāk patīk padomāt par visuma lielumu. Par to cik daudz planētas ir visumā. Par to cik lieli attālumi ir starp tam. Par to cik daudz gadu ir visumam un cig daudz dzīvojām mēs. Cik niecīgs esmu es visuma mērogā un cik niecīga ir cilvece. Mēs varam ar atombumbām sevi iznicināt un... who cares?

  5. RTU mums deva vairāk tādas vispārīgas zināšanas. Kad iestajos neko nezināju par programmēšanu un man iemācīja pamatus. OOP pamatus, SQL pamatus, vispār programmēšanas pamatus(if, cikli utt). Vienīgais ka nebija nojausmas kā to visu pielieto reālajā dzīvē, bet to saku saprast jau strādājot.

    Viss ir atkarīgs no cilvēka. Es drošivien to visu nevarētu apgūt mājās. Tomēr tur ir zināma disciplīna un sociālais moments.

×
×
  • Create New...