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, ...
- 01-28-2005 #1Linux 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
- 01-28-2005 #2Linux Engineer
- Join Date
- Nov 2004
- Location
- Ft. Polk, LA
- Posts
- 796
What you might need is a good php/mysql tutorial. I don't have one though, I learned by reading the manuals
- 01-28-2005 #3Same here, but i got books from library too.
Originally Posted by valan
What is EasyPHP? It like an IDE for PHP?"I am not an alcoholic, alcoholics go to meetings"
Registered Linux user = #372327
- 01-29-2005 #4^ From EasyPHP.com or something. Ack it runs on Windows!! Why are you asking us?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.
- 01-31-2005 #5Linux 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
- 01-31-2005 #6Linux Engineer
- Join Date
- Nov 2004
- Location
- Ft. Polk, LA
- 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
- 01-31-2005 #7Linux 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
- 01-31-2005 #8Linux Engineer
- Join Date
- Nov 2004
- Location
- Ft. Polk, LA
- 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:
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.Code:<?php $db = mysql_connect('localhost', 'user_name', 'password') or die('Could not connect to db: ' . mysql_error()); $query = 'SELECT * FROM my_table'; $result = mysql_query($query); for ($i = 0; $i < mysql_num_rows($result); $i++) { $line = mysql_fetch_array($result); for ($j = 0; $j < mysql_num_fields($result); $j++) echo "row $i field $j: " . $line[$j] . " \n"; } ?>
- 02-01-2005 #9Linux 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
- 02-01-2005 #10
Originally Posted by valan
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


Reply With Quote
