A little help with PHP and Mysql

by 6 replies
7
Hi everyone,

Yesterday i created a database with 5.000 records of Universitary Careers.

Now i'd like to read that records with a Query in php.

I don't want the code i'd like to know the procedure, as i readed i have to:

create php file
open mysql conex
mysql query
close mysql conex

Do i'm missing something? i'd like to learn to do this so i could print results in a html table and use Ajax to make it usable.

Thanks in advices.
#programming #mysql #php
  • Hi, there are a lot of good resources, including the PHP bible, but some people find it too technical, still when you get a little more comfortable with the process, it is a treasure trove of valuable information.


    in the time being, have a look at this website they have some good informational topics that may point you in the right direction.
    PHP 101: PHP For the Absolute Beginner
    • [ 1 ] Thanks
    • [1] reply
    • This is a great resource, thanks in advice!
  • Most tutorials should give you what you need.

    But, in general, create a php file, connect to the database (which can be in a separate php file), execute your query, send the results back to your calling javascript assuming you will be using ajax.

    You may want to consider using a javascript framework like jquery which can simplify the javascript side of things. A good starting point can be to establish the connection between your javascript and php script. Get the php script to send back a hello world or something. Then add the db stuff.
  • using a framework like codeigniter might help also...

    They use activeDB which makes database calls a snap.
    example
    $rows = $this->db->select('universities');

    compared to a normal query
    $result = mysql_query('SELECT * FROM universities');
    while($row = mysql_fetch_assoc($result)){
    //make table and output
    }
    mysql_free_result($result);
    • [ 1 ] Thanks
  • please check this url MySQL Tutorial - Query
    Hope this helps
  • Banned
    [DELETED]
  • Already solved, in About webiste i found an interesting and explaining resource as i wanted.

    I already made a script and i can read records from the database and print into formatted html table.

    Thanks everyone!

Next Topics on Trending Feed