1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

mysql = lame-o-vision

Discussion in 'PHP & Perl' started by dor@tehexploa, Jun 2, 2009.

  1. dor@tehexploa

    dor@tehexploa Registered Member

    Joined:
    Apr 25, 2009
    Messages:
    95
    Likes Received:
    25
    i have no interest in learning a database language

    i really just need to add a value and search for a value
    any good quick and dirty tutorials out there?
     
  2. Rick4691

    Rick4691 Registered Member Premium Member

    Joined:
    Feb 19, 2008
    Messages:
    70
    Likes Received:
    30
    Occupation:
    Programmer
    Location:
    Oceania
    SQL is supposed to be "English-like", so once you see it you should start to understand what it's doing ...

    1. Use phpMyAdmin to work with the SQL --- pretty straight-forward MySQL GUI that makes things somewhat easier;
    2. The SQL syntax for adding a record to a table would be:
      Code:
      insert into table_name (
      column_name1, 
      column_name2, 
      column_name3, 
      ... 
      ) 
      values (
      value_1, 
      value_2, 
      value_3, 
      ...
      );
    3. Searching for a record with a particular value goes like this:
      Code:
      select * 
      from table_name 
      where column_name = value;
      If the column in question is some sort of character based type (varchar, char, etc.) then value should be surrounded by single quotes - 'value'.

      If the column is numeric then do not use single quotes.

    O'Reilley probably has a Quick Reference available for MySQL. That should be all the help you need at this point.
     
    • Thanks Thanks x 1
  3. affdba1

    affdba1 BANNED BANNED

    Joined:
    Jul 22, 2008
    Messages:
    8
    Likes Received:
    1
    I found this document helpful.
    Can't post URLs yet, so add the http part yourself.

    rapidshare.com/files/242011750/Build.Your.Own.Database.Driven.Website.Using.PHP._.MySQL.3rd.Edition_page61_82.pdf.html