Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Anyone in here any good at PHP SQL? simple query

  • 25-11-2009 7:39am
    #1
    Registered Users, Registered Users 2 Posts: 234 ✭✭


    Hi Folks
    Got a SQL database with about 20 "events" in it.
    I want to filter out just the ones of a specific type.

    How would I go about doing this, through a PHP link?


Comments

  • Registered Users, Registered Users 2 Posts: 2,793 ✭✭✭oeb


    smartblaa wrote: »
    Hi Folks
    Got a SQL database with about 20 "events" in it.
    I want to filter out just the ones of a specific type.

    How would I go about doing this, through a PHP link?


    Of a particular type? What way are they structured in the database? And what exactly do you want to do?


  • Closed Accounts Posts: 25,848 ✭✭✭✭Zombrex


    smartblaa wrote: »
    Hi Folks
    Got a SQL database with about 20 "events" in it.
    I want to filter out just the ones of a specific type.

    How would I go about doing this, through a PHP link?

    PHP is a programming language. A "PHP link" is a link to a PHP script instead of a static HTML file, the PHP script is run by the PHP interpreter on the web server and produces output (most likely in HTML format but really any format you like) that is sent to the web browser.

    It is a way of making dynamic web pages, ie web pages that are not static files but are constructed on the fly based on certain criteria.

    Like most programming languages PHP can talk to a database. There is no "PHP SQL", PHP used a database interface (depending on what type of database you have, say MySQL) and just passes standard SQL commands to the database and gets back the results which it can then manipulate before sending to the web browser (say putting results in a nice HTML table).

    To get from a DB entries of just a certain type you would use a SELECT statement in SQL with a WHERE clause something like
    SELECT * FROM mytable WHERE type_column = 'typeA';
    

    To query a database in a PHP script that can talk to a database you need to write the PHP script and then have that run through a web server like Apache.

    If you have no experience with PHP (and your post suggests you don't) I would recommend buying an book on the language, as like most languages there is a lot to cover and I think books are far better than online tutorials. A lot of books on PHP cover databases as well.


  • Closed Accounts Posts: 8,866 ✭✭✭Adam


    here's a decent quick intro to php/mysql http://www.tizag.com/mysqlTutorial/index.php


Advertisement