noob php programming question

Discussion in 'PHP' started by phpwreker, Nov 3, 2012.

  1. #1
    [​IMG]

    ok .. this may sound really stupid .. but my question was ..

    all those keywords and statements stays in the hard disk right?

    i mean .. i like to think of the hard disk as a flat file system of files ... which is the only way i know how to see them

    binary files like stapler pins

    [​IMG]

    the php interpretor is on the hard disk .. right ?
     
    phpwreker, Nov 3, 2012 IP
  2. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #2
    It's on the web server's hard disk. (Or on yours if you're running a local web server.)

    The intepreter recognizes the keywords, it's not a list of them.
     
    Rukbat, Nov 3, 2012 IP
  3. phpwreker

    phpwreker Greenhorn

    Messages:
    67
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #3
    i was reading a tutorial on retreiving files.. with the help of php and mysql

    that means mostly retreving rows or records... in the table

    for example after trying to insert data from a form

    INSERT INTO "tablename" VALUES ( $variable_name , $variable_name , $variable_name) from the form

    i will try to retrieve these from the table that is inserted into ... right ?






    can anyone explain what that data,filetype means in the below mysql select query?


    $query = "SELECT data,filetype FROM "tablename" where id=$id";


    i have also learned from somewhere that you can create a link to a particular row or record in the table


    <a href = <? echo $id; ?>
     
    Last edited: Nov 3, 2012
    phpwreker, Nov 3, 2012 IP
  4. phpwreker

    phpwreker Greenhorn

    Messages:
    67
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #4
    maybe this is how the "keywords" really work ..

    [​IMG]

    [​IMG]

    [​IMG]
     
    Last edited: Nov 4, 2012
    phpwreker, Nov 4, 2012 IP
  5. phpwreker

    phpwreker Greenhorn

    Messages:
    67
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #5
    [​IMG]








    [​IMG]



    [​IMG]




    i dont see an edit button .. this pic was missing from the above thread .. i dont know where did it dissapear into ..lol
     
    phpwreker, Nov 4, 2012 IP
  6. phpwreker

    phpwreker Greenhorn

    Messages:
    67
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #6
    [​IMG]

    and if you keep this here .. i guess it give you a better understanding of how html php mysql .. works.. how code works in a line by line manner

    you know the variable name , variable value that comes from an html form .. then the php script starts working .. inserts the value to the variable name in the database table of mysql .....
     
    phpwreker, Nov 4, 2012 IP
  7. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #7
    Right - if the fields (columns) in the database are numeric. If they're text, it's

    INSERT INTO "tablename" VALUES ( '$variable_name' , '$variable_name' , '$variable_name')

    Text and date field data gets quoted, numeric doesn't.

    They're field (column) names. You're only getting those two fields, even if there are more fields in the table. You also insert and update specific fields that way.


    Only if $id (which is a PHP variable) already has the value of the field in the database. (A record [or row] is an array of fields, and you usually use a variable for a single field.) $id gets the value from the code that SELECTs it and puts it into $id.
     
    Rukbat, Nov 4, 2012 IP
  8. phpwreker

    phpwreker Greenhorn

    Messages:
    67
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #8
    i have decided to sell icecream
     
    Last edited: Dec 4, 2012
    phpwreker, Dec 4, 2012 IP
  9. PinoyEngine™

    PinoyEngine™ Well-Known Member

    Messages:
    298
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    145
    #9
    Better, you won't need patience in selling and making ice cream, than in learning a new computer language.
     
    PinoyEngine™, Dec 4, 2012 IP
  10. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #10
    Because you're trying to learn computer technology, programming, PHP and SQL all at once, instead of taking them in a logical order.

    Forget how data sits on a hard drive or how keywords are saved - those have nothing to do with programming. If you want to design hardware, forget about programming and get a degree in digital electronics.

    If you want to learn programming, start by learning programming. Algorithms + Data Structures.pdf may help. And don't expect to get it in an hour - it will probably take a couple of months to read it all and understand it.
     
    Rukbat, Dec 4, 2012 IP