I need a basic tutorial on MySql!!!!!!!!!

Discussion in 'Tutorials' started by danvictor2041, Dec 12, 2011.

  1. danvictor2041

    danvictor2041 New Member

    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    0
    I need a basic tutorial on MySql!!!!!
     
  2. cybrax

    cybrax Community Advocate Community Support

    Messages:
    764
    Likes Received:
    27
    Trophy Points:
    0
  3. mariannaguide56

    mariannaguide56 New Member

    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    Hi ,
    Just a "one cent" opinion .
    Don't use Mysql anymore it's outdated and according to php.net it's depreciated (in future releases it will not be supported anymore ) . If you insist to use this old extension , code your scripts according to security standards or you can be a victim of SQL-injection .
    Fortunately this web-host support the newer extensions ( mysqli and PDO ) . Use them instead , as these are the future methods of database-driven web-development . Beside all the new features , these extensions support OOP coding methodology and prepared statements . Have a look at this nice article " Using PDO Objects in PHP " .
    Happy coding :)
     
  4. cybrax

    cybrax Community Advocate Community Support

    Messages:
    764
    Likes Received:
    27
    Trophy Points:
    0
    Every cent counts and yes the PDO syntax is a little bit tidier and does provide some new features that give an extra layers of protection.

    However much of the internal structure remains the same as old SQL plus many of the advanced tutorials and code snippets across the web have NOT been rewritten for PDO yet. So for anybody just getting started with databses would benefit from a basic understanding of SQL then move up/over to PDO once they feel more comfortable.

    PHP:
    # Regular mySQL
    mysql_query("INSERT INTO folks (name, addr, city) values ($name$addr$city)");


    # PDO with named placeholders
    $STH $DBH->("INSERT INTO folks (name, addr, city) value (:name, :addr, :city)");
     

Share This Page