1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

What is php query?

Discussion in 'PHP' started by kerjadu, Jan 17, 2017.

  1. #1
    i am learning php, i got keyword : php query

    but i dont remember from where, can you tell me what is it?
    SEMrush
    query is for mysql/running in phpmyadmin right? so what is php query?
     
    Solved! View solution.
    kerjadu, Jan 17, 2017 IP
    SEMrush
  2. #2
    hey there,

    you are probably thinking about running queries on mysql from php. This is a very common function that you will definitely need to learn. A query is basically a request you make to a database to retrieve specific information. A very basic query would be: "SELECT * FROM table LIMIT 10" which means select all the columns in the table and return 10 rows.

    Definitely check this link out for more info: http://php.net/manual/en/function.mysql-query.php
     
    Adbuff, Jan 18, 2017 IP
  3. SpacePhoenix

    SpacePhoenix Well-Known Member

    Messages:
    129
    Likes Received:
    15
    Best Answers:
    1
    Trophy Points:
    120
    #3
    @Adbuff please don't link to the old extension which was deprecated in version 5.5 of PHP and was removed in version 7 of PHP. @kerjadu you should be using either the mysqli_* extension (note the i there) or PDO.

    For either the mysqli_*or PDO you should always use prepared statements. By always using prepared statements even if the source of the data is from the system, if you ever change the source of the data to some supplied by the user you won't accidentally open up a security hole
     
    SpacePhoenix, Jan 19, 2017 IP
  4. kerjadu

    kerjadu Well-Known Member

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    113
    #4
    thank you all
     
    kerjadu, Jan 19, 2017 IP