Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15
hello there, is there anyone using/has used EasyPHP.......that can help with a few questions. Ive installed it and it works well, but I dont know how to create a table, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Nov 2004
    Posts
    167

    EasyPHP, anyone


    hello there,

    is there anyone using/has used EasyPHP.......that can help with a few questions. Ive installed it and it works well, but I dont know how to create a table, add the sql to my index.php file.......

    Ive viewed the EasyPHP page, viewed the forums, but mostly not in English. Can anyone help.

    thanks
    Tokunbo

  2. #2
    Linux Engineer
    Join Date
    Nov 2004
    Location
    home
    Posts
    796
    What you might need is a good php/mysql tutorial. I don't have one though, I learned by reading the manuals

  3. #3
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    Quote Originally Posted by valan
    What you might need is a good php/mysql tutorial. I don't have one though, I learned by reading the manuals
    Same here, but i got books from library too.

    What is EasyPHP? It like an IDE for PHP?
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

  4. $spacer_open
    $spacer_close
  5. #4
    Linux User Muser's Avatar
    Join Date
    May 2004
    Location
    Maryland
    Posts
    363
    EasyPHP is a complete software package allowing to use all the power and the flexibility that offers the dynamic language PHP and the effecient use of databases under Windows. Package includes an Apache server, a MySQL database, a fully PHP execution, as well as easy development tools for your web site or your applications.
    ^ From EasyPHP.com or something. Ack it runs on Windows!! Why are you asking us?

  6. #5
    Linux Newbie
    Join Date
    Nov 2004
    Posts
    167
    hi,

    This is what I wanted to do:
    ............http://www.linuxforums.org/forum/topic-31843.html

    Note the first post by me and the last one by kpzani...so I began asking around, and saw some tutorials on PHP, MYSQL online, then came across EasyPHP....... which was said to be easy to install etc....

    The tutorials available on their site doesnt give much info...tho.....my problem is with regards to the myPHPAdmin tool. Yes its quite friendly, but ive fiddled around with it, created a table and I exported it(I dont know if thats the right thing to do)...it saves a file with an (.sql) tag....now, how do I insert this into the (.php) file..........

    Tokunbo

  7. #6
    Linux Engineer
    Join Date
    Nov 2004
    Location
    home
    Posts
    796
    You don't insert the table into the php file, you use php's mysql functions to access it.

    http://php.net/mysql

  8. #7
    Linux Newbie
    Join Date
    Nov 2004
    Posts
    167
    hi there,

    thanks for the info valan, hope you dont mind, but for example, this is the sample 'pets.sql' file that was generated, pls how will my php code access it....as in can you give me an example. The site you posted in your previous mail was quite useful, but I wont know where to start from,,,,as in since all the possible sql functions were listed there, I dont know which is which and how to string them altogether.

    I cant find a tutorial(ive searched and searched) to describe the whole proess, with at least one example, relating to a database....as in how can I write a phpcode to access the file...below:

    # phpMyAdmin SQL Dump
    # version 2.5.3
    # http://www.phpmyadmin.net
    #
    # Host: localhost
    # Generation Time: Jan 27, 2005 at 10:29 PM
    # Server version: 4.0.15
    # PHP Version: 4.3.3
    #
    # Database : `test`
    #

    # --------------------------------------------------------

    #
    # Table structure for table `Pets`
    #

    CREATE TABLE `Pets` (
    `petname` varchar(20) NOT NULL default '',
    `ownersname` varchar(20) NOT NULL default '',
    `sex` char(1) NOT NULL default '',
    `color` varchar(20) NOT NULL default ''
    ) TYPE=MyISAM;

    #
    # Dumping data for table `Pets`
    #

    INSERT INTO `Pets` VALUES ('', '', '', '');
    ------------

    thanks
    Tokunbo

  9. #8
    Linux Engineer
    Join Date
    Nov 2004
    Location
    home
    Posts
    796
    You don't need that at all with PHP. Here's a simple little script that will connect to a MySQL server, run a query, and send out the results to show you some basics:

    Code:
    <?php
    $db = mysql_connect&#40;'localhost', 'user_name', 'password'&#41;
        or die&#40;'Could not connect to db&#58; ' . mysql_error&#40;&#41;&#41;;
    $query = 'SELECT * FROM my_table';
    $result = mysql_query&#40;$query&#41;;
    
    for &#40;$i = 0; $i < mysql_num_rows&#40;$result&#41;; $i++&#41;
    &#123;
        $line = mysql_fetch_array&#40;$result&#41;;
        for &#40;$j = 0; $j < mysql_num_fields&#40;$result&#41;; $j++&#41;
            echo "row $i field $j&#58; " . $line&#91;$j&#93; . "
    \n";
    &#125;
    ?>
    Put in the correct things for host, user, password, and table, wrap it with some html, and you will have an ugly listing of everything in the specified table when you run it.

  10. #9
    Linux Newbie
    Join Date
    Nov 2004
    Posts
    167
    hi valan,

    thanks for the code. I put things in place and it worked. I got a display of my data in a vertical(downward) format.

    Pls another question: how about if I want the data displayed in a tabular form ex:

    NAME LOCATION SCHOOL
    .......... ............... ................
    .......... ............... ................


    thanks
    Tokunbo

  11. #10
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    Quote Originally Posted by valan
    You don't need that at all with PHP. Here's a simple little script that will connect to a MySQL server, run a query, and send out the results to show you some basics:

    Code:
    <?php
    $db = mysql_connect&#40;'localhost', 'user_name', 'password'&#41;
        or die&#40;'Could not connect to db&#58; ' . mysql_error&#40;&#41;&#41;;
    $query = 'SELECT * FROM my_table';
    $result = mysql_query&#40;$query&#41;;
    
    for &#40;$i = 0; $i < mysql_num_rows&#40;$result&#41;; $i++&#41;
    &#123;
        $line = mysql_fetch_array&#40;$result&#41;;
        for &#40;$j = 0; $j < mysql_num_fields&#40;$result&#41;; $j++&#41;
            echo "row $i field $j&#58; " . $line&#91;$j&#93; . "
    \n";
    &#125;
    ?>
    Put in the correct things for host, user, password, and table, wrap it with some html, and you will have an ugly listing of everything in the specified table when you run it.

    How does this know which database on the server to use? I can't see it anywhere at the moment, it could just be me being blind!! I usually have to use the mysql_select_db() function after mysql_connect() to tell it which database to use.
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •