A little help with PHP and Mysql

6 replies
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.
#mysql #php
  • Profile picture of the author Tim Franklin
    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
    Signature
    Bitcoin | Crypto | Blockchain Secrets |
    {{ DiscussionBoard.errors[4722796].message }}
    • Profile picture of the author helfgott
      Originally Posted by Tim Franklin View Post

      in the time being, have a look at this website they have some good informational topics that may point you in the right direction...
      This is a great resource, thanks in advice!
      {{ DiscussionBoard.errors[4723761].message }}
  • Profile picture of the author jmartinez
    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.
    {{ DiscussionBoard.errors[4724539].message }}
  • Profile picture of the author Unomateo
    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);
    {{ DiscussionBoard.errors[4725203].message }}
  • Profile picture of the author weaveronline
    please check this url MySQL Tutorial - Query
    Hope this helps
    Signature

    Thanks & Regards,
    Reach us at dukeduke600@gmail.com.
    Web Design| Logo Design | Banner Design | Web Development | Mobile Applications [iPhone/iPad/Android/Windows Phone]

    {{ DiscussionBoard.errors[4728778].message }}
  • Profile picture of the author helfgott
    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!
    {{ DiscussionBoard.errors[4730496].message }}

Trending Topics