Jump to content
php.lv forumi

datu baazes nosaukums


labaiss

Recommended Posts

  • 5 months later...

Ja kodē Symfony PHP ietvarā, izmantojot Propel ORMu tad labāk izskatās, ja tabulu nosaukumi ir vienskaitlī. Jo Propel piedāvā uzģenerēt modeli tabulu klasēm un metodēm, ņemot vērā DB struktūru. Tad, piemēram: UserPeer::getUser() vienas rindas atlasei, UserPeer::getUsers() vairāku rindu atlasei.

 

Bet vispār pa lielam jau tas ir sīkums, kamēr viena projekta ietvaros turies pie viena principa.

Edited by bfj
Link to comment
Share on other sites

Arceros jau ka man vienreiz šādi gadījās, bet nevaru atcerēties kā bija.

 

Kā jāraksta datubāzes tabulas nosaukums, ja tas ir cipars?

 

 

Jo ja rakstu šadi vnk 50, tas nestrādā!

    if (isset($_POST['l'])) { 
       $query = sprintf("  INSERT INTO 50  

 

bet ja tas ir vārds, tad viss ok!

    if (isset($_POST['l'])) { 
       $query = sprintf("  INSERT INTO tablename

 

    if (isset($_POST['l'])) { 
       $query = sprintf("  INSERT INTO [50]

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...