|
[root@lintush
~]# yum groupinstall 'MySQL Database' |
|
[root@lintush
~]# yum install php-mysql mod_auth_mysql |
|
[root@lintush
~]# chkconfig --level 235 mysqld on |
|
[root@lintush ~]#
service mysqld start Initializing MySQL database: Installing MySQL system tables... OK Filling help tables... OK To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: /usr/bin/mysqladmin -u root password 'new-password' /usr/bin/mysqladmin -u root -h lintush.m2t.hm password 'new-password' See the manual for more instructions. You can start the MySQL daemon with: cd /usr ; /usr/bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl cd mysql-test ; perl mysql-test-run.pl Please report any problems with the /usr/bin/mysqlbug script! The latest information about MySQL is available on the web at http://www.mysql.com Support MySQL by buying support/licenses at http://shop.mysql.com [ OK ] Starting MySQL: [ OK ]
|
|
[root@lintush
~]# /usr/bin/mysqladmin
-u root password 'secret_password' |
|
[root@lintush ~]#
/usr/bin/mysqladmin -u root -h lintush.m2t.hm password
'secret_password' |
|
[root@lintush
~]# mysql_install_db
Installing MySQL system tables... OK Filling help tables... OK To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: /usr/bin/mysqladmin -u root password 'new-password' /usr/bin/mysqladmin -u root -h lintush.m2t.hm password 'new-password' See the manual for more instructions. You can start the MySQL daemon with: cd /usr ; /usr/bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl cd mysql-test ; perl mysql-test-run.pl Please report any problems with the /usr/bin/mysqlbug script! The latest information about MySQL is available on the web at http://www.mysql.com Support MySQL by buying support/licenses at http://shop.mysql.com |
|
root@lintush
~]# mysql -u root -p
Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.0.45 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> |
|
mysql> help ; For information about MySQL products and services, visit: http://www.mysql.com/ For developer information, including the MySQL Reference Manual, visit: http://dev.mysql.com/ To buy MySQL Network Support, training, or other products, visit: https://shop.mysql.com/ List of all MySQL commands: Note that all text commands must be first on line and end with ';' ? (\?) Synonym for `help'. clear (\c) Clear command. connect (\r) Reconnect to the server. Optional arguments are db and host. delimiter (\d) Set statement delimiter. NOTE: Takes the rest of the line as new delimiter. edit (\e) Edit command with $EDITOR. ego (\G) Send command to mysql server, display result vertically. exit (\q) Exit mysql. Same as quit. go (\g) Send command to mysql server. help (\h) Display this help. nopager (\n) Disable pager, print to stdout. notee (\t) Don't write into outfile. pager (\P) Set PAGER [to_pager]. Print the query results via PAGER. print (\p) Print current command. prompt (\R) Change your mysql prompt. quit (\q) Quit mysql. rehash (\#) Rebuild completion hash. source (\.) Execute an SQL script file. Takes a file name as an argument. status (\s) Get status information from the server. system (\!) Execute a system shell command. tee (\T) Set outfile [to_outfile]. Append everything into given outfile. use (\u) Use another database. Takes database name as argument. charset (\C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets. warnings (\W) Show warnings after every statement. nowarning (\w) Don't show warnings after every statement. For server side help, type 'help contents' mysql> |
|
mysql>
help contents;
You asked for help about help category: "Contents" For more information, type 'help <item>', where <item> is one of the following categories: Account Management Administration Data Definition Data Manipulation Data Types Functions Functions and Modifiers for Use with GROUP BY Geographic Features Language Structure Storage Engines Stored Routines Table Maintenance Transactions Triggers mysql> |
|
mysql>
help Data Definition;
You asked for help about help category: "Data Definition" For more information, type 'help <item>', where <item> is one of the following topics: ALTER DATABASE ALTER TABLE ALTER VIEW CONSTRAINT CREATE DATABASE CREATE INDEX CREATE TABLE CREATE VIEW DROP DATABASE DROP INDEX DROP TABLE DROP VIEW MERGE RENAME TABLE mysql> |
|
mysql>
help create database;
Name: 'CREATE DATABASE' Description: Syntax: CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name [create_specification [create_specification] ...] create_specification: [DEFAULT] CHARACTER SET charset_name | [DEFAULT] COLLATE collation_name CREATE DATABASE creates a database with the given name. To use this statement, you need the CREATE privilege for the database. CREATE SCHEMA is a synonym for CREATE DATABASE as of MySQL 5.0.2. URL: http://dev.mysql.com/doc/refman/5.0/en/create-database.html mysql> |
|
mysql>
show databases;
+--------------------+ | Database | +--------------------+ | information_schema | | mysql | | test | +--------------------+ 3 rows in set (0.00 sec) mysql> |
|
mysql>
create database contacts;
Query OK, 1 row affected (0.00 sec) mysql> |
|
mysql>
show databases;
+--------------------+ | Database | +--------------------+ | information_schema | | contacts | | mysql | | test | +--------------------+ 4 rows in set (0.00 sec) |
|
mysql>
use contacts;
Database changed mysql> |
|
mysql>
show tables;
Empty set (0.00 sec) mysql> |
|
mysql>
create table family
-> ( -> fam_id int not null, -> fam_fname varchar(50) not null, -> fam_lname varchar(50) not null, -> fam_address1 varchar(50) not null, -> fam_address2 varchar(50) not null, -> fam_phone varchar(13) not null, -> fam_comments varchar(100) not null -> ); Query OK, 0 rows affected (0.00 sec) mysql> |
|
mysql>
show tables;
+--------------------+ | Tables_in_contacts | +--------------------+ | family | +--------------------+ 1 row in set (0.00 sec) mysql> |
|
mysql>
create table friends ( fr_id int not null, fr_fname
varchar(50) not null, fr_lname varchar(50) not null, fr_address1
varchar(50) not null, fr_address2 varchar(50) not null, fr_phone
varchar(13) not null, fr_comments varchar(100) not null );
Query OK, 0 rows affected (0.01 sec) mysql> |
|
mysql>
show tables;
+--------------------+ | Tables_in_contacts | +--------------------+ | family | | friends | +--------------------+ 2 rows in set (0.00 sec) mysql> |
|
mysql>
create table work ( wr_id int not null, wr_fname varchar(50)
not null, wr_lname varchar(50) not null, wr_address1 varchar(50)
not null, wr_address2 varchar(50) not null, wr_phone varchar(13)
not null, wr_comments varchar(100) not null );
Query OK, 0 rows affected (0.00 sec) mysql> |
|
mysql>
show tables;
+--------------------+ | Tables_in_contacts | +--------------------+ | family | | friends | | work | +--------------------+ 3 rows in set (0.00 sec) mysql> |
|
mysql>
insert into family values(1,'Mike','Robinson','5534 S.
State','Chicago, IL 60635','(773)575-5678','He is graduating
next month.');
Query OK, 1 row affected (0.00 sec) mysql> |
|
mysql>
select * from family;
+--------+-----------+-----------+---------------+-------------------+---------------+------------------------------+ | fam_id | fam_fname | fam_lname | fam_address1 | fam_address2 | fam_phone | fam_comments | +--------+-----------+-----------+---------------+-------------------+---------------+------------------------------+ | 1 | Mike | Robinson | 5534 S. State | Chicago, IL 60635 | (773)575-5678 | He is graduating next month. | +--------+-----------+-----------+---------------+-------------------+---------------+------------------------------+ 1 row in set (0.00 sec) mysql> |
|
mysql>
insert into family (fam_id,fam_fname,fam_lname)
values(2,'Tony',' Banderas');
Query OK, 1 row affected, 4 warnings (0.00 sec) mysql> |
|
mysql>
select * from family;
+--------+-----------+-----------+---------------+-------------------+---------------+------------------------------+ | fam_id | fam_fname | fam_lname | fam_address1 | fam_address2 | fam_phone | fam_comments | +--------+-----------+-----------+---------------+-------------------+---------------+------------------------------+ | 1 | Mike | Robinson | 5534 S. State | Chicago, IL 60635 | (773)575-5678 | He is graduating next month. | | 2 | Tony | Banderas | | | | | +--------+-----------+-----------+---------------+-------------------+---------------+------------------------------+ 2 rows in set (0.00 sec) mysql> |
|
mysql>
grant all on contacts.* to 'test'@'localhost' identified by
'user' with grant option;
Query OK, 0 rows affected (0.00 sec) mysql> |
|
mysql>
grant all on contacts.* to 'test'@'%' identified by 'user'
with grant option; Query OK, 0 rows affected (0.00 sec) mysql> |
|
mysql>
flush privileges;
Query OK, 0 rows affected (0.00 sec) mysql> |
|
mysql>
use contacts;
Database changed mysql> alter table family modify fam_id MEDIUMINT NOT NULL PRIMARY KEY AUTO_INCREMENT; Query OK, 9 rows affected (0.00 sec) Records: 9 Duplicates: 0 Warnings: 0 mysql> alter table friends modify fr_id MEDIUMINT NOT NULL PRIMARY KEY AUTO_INCREMENT; Query OK, 0 rows affected (0.01 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> alter table family modify fam_id MEDIUMINT NOT NULL PRIMARY KEY AUTO_INCREMENT; Query OK, 0 rows affected (0.00 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> |
|
mysql>
quit [root@lintush /]# |
|
[root@lintush
~]# cd /var/www/html
[root@lintush html]# |
|
[root@lintush
html]# gedit getchoice.php |
|
<HTML>
<HEAD> </HEAD> <BODY> <FORM ACTION="processchoice.php" METHOD="POST"> <P><STRONG>What table would you like to work with?</STRONG></P> <SELECT NAME="table"> <p> <?php $conn = mysql_connect("localhost", "test", "user"); // Provides MySQL with host & user credentials mysql_select_db("contacts",$conn); // Select database to work with $sql = "SHOW TABLES"; // Create query $result = mysql_query($sql, $conn) or die(mysql_error()); // Process query while($newArray = mysql_fetch_array($result)) { echo "<OPTION VALUE=\"".$newArray[0]."\">".$newArray[0]."</OPTION>"; echo "<BR>"; } echo "</SELECT>"; php?> </P> <P><STRONG>What would you like to do?</STRONG></P> <P><INPUT TYPE="RADIO" CHECKED="checked" NAME="option" VALUE="add">Add Records<BR> <INPUT TYPE="RADIO" NAME="option" VALUE="del">Delete Records<BR> <INPUT TYPE="RADIO" NAME="option" VALUE="view">View Records</P> <INPUT TYPE="SUBMIT" VALUE="submit"> </FORM> </BODY> </HTML> |
|
[root@lintush
html]# gedit processchoice.php |
|
<?php
session_start(); if (!isset($_POST['table'])) { $table = $_SESSION['tb']; $choice = $_SESSION['op']; }else{ $_SESSION['tb'] = $_POST['table']; $table = $_POST['table']; $_SESSION['op'] = $_POST['option']; $choice = $_POST['option']; } ProcessHTML_Top(); switch($choice) { case "add" : AddRecords($table); break; case "del" : DeleteRecords($table); break; case "view" : ViewRecords($table); break; default : echo "Nothing was obtained."; } ProcessHTML_Bottom(); function ProcessHTML_Top(){ php?> <HTML> <HEAD> </HEAD> <BODY> <?php } function ProcessHTML_Bottom(){ php?> </BODY> </HTML> <?php } function AddRecords($tb){ $Fn = $_POST['Fname']; $Ln = $_POST['Lname']; $adr1 = $_POST['addrl1']; $adr2 = $_POST['addrl2']; $ph = $_POST['phone']; $cm = $_POST['comment']; if (!isset($_POST['submit'])) { php?> <H2>Working with table <?php echo "<FONT COLOR=\"RED\"><STRONG>$tb</STRONG></FONT>";php?></H2> <FORM ACTION="<?php echo $PHP_SELF;?>" METHOD="POST"> <P>First Name:<INPUT TYPE="TEXT" SIZE="25" MAXLENGTH="50" NAME="Fname"><br /> Last Name: <INPUT TYPE="TEXT" SIZE="25" MAXLENGTH="50" NAME="Lname"><br /> Address line1: <INPUT TYPE="TEXT" SIZE="50" MAXLENGTH="50" NAME="addrl1"><br /> Address line2: <INPUT TYPE="TEXT" SIZE="50" MAXLENGTH="50" NAME="addrl2"><br /> Phone: <INPUT TYPE="TEXT" SIZE="13" MAXLENGTH="13" NAME="phone"><br /> <TEXTAREA ROWS="5" COLS="20" NAME="comment" WRAP="physical"></textarea><br /> </P> <INPUT TYPE="SUBMIT" value="submit" name="submit"> </FORM> <?php ProcessHTML_Bottom(); }else{ $conn =mysql_connect("localhost", "test", "user"); //pick the database to connect mysql_select_db("contacts",$conn); switch($tb){ case 'family' : mysql_query("INSERT INTO $tb (fam_fname,fam_lname,fam_address1,fam_address2,fam_phone,fam_comments) VALUES('$Fn','$Ln','$adr1','$adr2','$ph','$cm')"); break; case 'friends' : mysql_query("INSERT INTO $tb (fr_fname,fr_lname,fr_address1,fr_address2,fr_phone,fr_comments) VALUES('$Fn','$Ln','$adr1','$adr2','$ph','$cm')"); break; case 'work' : mysql_query("INSERT INTO $tb (wr_fname,wr_lname,wr_address1,wr_address2,wr_phone,wr_comments) VALUES('$Fn','$Ln','$adr1','$adr2','$ph','$cm')"); break; default : echo "No data was added! Something went wrong. Check your log."; } echo "<STRONG>Record Added!</STRONG><BR>"; mysql_close($con); echo "<a href=\"getchoice.php\">Return to Main Menu</><BR>"; echo "<a href=\"processchoice.php\">Add Another Contact</><BR>"; } } function DeleteRecords($tbl){ switch($tbl){ case 'family' : ProcessFamily($tbl); break; case 'friends' : ProcessFriends($tbl); break; case 'work' : ProcessWork($tbl); break; default : echo "<h2>Nothing to do</h2>"; } } function ProcessWork($tb){ $conn =mysql_connect("localhost", "test", "user"); //pick the database to connect mysql_select_db("contacts",$conn); echo "<H2>Delete Mode on table: <FONT COLOR=\"RED\"><STRONG>$tb</STRONG></FONT></H2>"; echo "<FORM ACTION=\"".$PHP_SELF."\" METHOD=\"POST\">"; if (isset($_POST['submit'])) { $recs = $_POST['recs']; echo "<font color=\"red\"><h2>Deleted records</h2>"; echo "<table border=1><tr><td>Selected</td><td>Record#</td><td>First Name </td><td>Last Name</td><td>Address Line1</td><td>Address Line2</td><td>Phone#</td><td>Comments</td></tr>"; foreach ($recs as $item) { $sql = "SELECT * FROM $tb where wr_id = $item"; $result = mysql_query($sql, $conn) or die(mysql_error()); while($newArray = mysql_fetch_array($result)) { $recno = $newArray['wr_id']; $fname = $newArray['wr_fname']; $lname = $newArray['wr_lname']; $adr1 = $newArray['wr_address1']; $adr2 = $newArray['wr_address2']; $phone = $newArray['wr_phone']; $comm = $newArray['wr_comments']; echo "<tr><td>$recno</td><td>$fname</td><td>$lname</td><td>$adr1</td><td>$adr2</td><td>$phone</td><td>$comm</td></tr>"; } $sql = "DELETE FROM $tb where wr_id = $item"; $result = mysql_query($sql, $conn) or die(mysql_error()); } echo "</table><br><br></font>"; } $sql = "SELECT * FROM $tb"; $result = mysql_query($sql, $conn) or die(mysql_error()); echo "<font color=\"blue\"><h2>Current Records on $tb database</h2></font>"; echo "<table border=1><tr><td>Selected</td><td>Record#</td><td>First Name </td><td>Last Name</td><td>Address Line1</td><td>Address Line2</td><td>Phone#</td><td>Comments</td></tr>"; while($newArray = mysql_fetch_array($result)) { $recno = $newArray['wr_id']; $fname = $newArray['wr_fname']; $lname = $newArray['wr_lname']; $adr1 = $newArray['wr_address1']; $adr2 = $newArray['wr_address2']; $phone = $newArray['wr_phone']; $comm = $newArray['wr_comments']; echo "<tr><td><input type=\"checkbox\" value=\"".$recno."\" name=\"recs[]\"></td><td>$recno</td><td>$fname</td><td>$lname</td><td>$adr1</td><td>$adr2</td><td>$phone</td><td>$comm</td></tr>"; } echo "<th colspan=\"8\" align=\"center\"><INPUT TYPE=\"submit\" value=\"submit\" name=\"submit\"></th>"; echo "</FORM>"; echo "</table>"; echo "<P><a href=\"getchoice.php\">Return to Main Menu</></P>"; } function ProcessFriends($tb){ $conn =mysql_connect("localhost", "test", "user"); mysql_select_db("contacts",$conn); echo "<H2>Delete Mode on table: <FONT COLOR=\"RED\"><STRONG>$tb</STRONG></FONT></H2>"; echo "<FORM ACTION=\"".$PHP_SELF."\" METHOD=\"POST\">"; if (isset($_POST['submit'])) { $recs = $_POST['recs']; echo "<font color=\"red\"><h2>Deleted records</h2>"; echo "<table border=1><tr><td>Selected</td><td>Record#</td><td>First Name</td><td>Last Name</td><td>Address Line1</td><td>Address Line2</td><td>Phone#</td><td>Comments</td></tr>"; foreach ($recs as $item) { $sql = "SELECT * FROM $tb where fr_id = $item"; $result = mysql_query($sql, $conn) or die(mysql_error()); while($newArray = mysql_fetch_array($result)) { $recno = $newArray['fr_id']; $fname = $newArray['fr_fname']; $lname = $newArray['fr_lname']; $adr1 = $newArray['fr_address1']; $adr2 = $newArray['fr_address2']; $phone = $newArray['fr_phone']; $comm = $newArray['fr_comments']; echo "<tr><td>$recno</td><td>$fname</td><td>$lname</td><td>$adr1</td><td>$adr2</td><td>$phone</td><td>$comm</td></tr>"; } $sql = "DELETE FROM $tb where fr_id = $item"; $result = mysql_query($sql, $conn) or die(mysql_error()); } echo "</table><br><br></font>"; } $sql = "SELECT * FROM $tb"; $result = mysql_query($sql, $conn) or die(mysql_error()); echo "<font color=\"blue\"><h2>Current Records on $tb database</h2></font>"; echo "<table border=1><tr><td>Selected</td><td>Record#</td><td>First Name </td><td>Last Name</td><td>Address Line1</td><td>Address Line2</td><td>Phone#</td><td>Comments</td></tr>"; while($newArray = mysql_fetch_array($result)) { //give a name to the fields $recno = $newArray['fr_id']; $fname = $newArray['fr_fname']; $lname = $newArray['fr_lname']; $adr1 = $newArray['fr_address1']; $adr2 = $newArray['fr_address2']; $phone = $newArray['fr_phone']; $comm = $newArray['fr_comments']; echo "<tr><td><input type=\"checkbox\" value=\"".$recno."\" name=\"recs[]\"></td><td>$recno</td><td>$fname</td><td>$lname</td><td>$adr1</td><td>$adr2</td><td>$phone</td><td>$comm</td></tr>"; } echo "<th colspan=\"8\" align=\"center\"><INPUT TYPE=\"submit\" value=\"submit\" name=\"submit\"></th>"; echo "</FORM>"; echo "</table>"; echo "<P><a href=\"getchoice.php\">Return to Main Menu</></P>"; } function ProcessFamily($tb){ $conn =mysql_connect("localhost", "test", "user"); mysql_select_db("contacts",$conn); echo "<H2>Delete Mode on table: <FONT COLOR=\"RED\"><STRONG>$tb</STRONG></FONT></H2>"; echo "<FORM ACTION=\"".$PHP_SELF."\" METHOD=\"POST\">"; if (isset($_POST['submit'])) { $recs = $_POST['recs']; echo "<font color=\"red\"><h2>Deleted records</h2>"; echo "<table border=1><tr><td>Selected</td><td>Record#</td><td>First Name </td><td>Last Name</td><td>Address Line1</td><td>Address Line2</td><td>Phone#</td><td>Comments</td></tr>"; foreach ($recs as $item) { $sql = "SELECT * FROM $tb where fam_id = $item"; $result = mysql_query($sql, $conn) or die(mysql_error()); while($newArray = mysql_fetch_array($result)) { $recno = $newArray['fam_id']; $fname = $newArray['fam_fname']; $lname = $newArray['fam_lname']; $adr1 = $newArray['fam_address1']; $adr2 = $newArray['fam_address2']; $phone = $newArray['fam_phone']; $comm = $newArray['fam_comments']; echo "<tr><td>$recno</td><td>$fname</td><td>$lname</td><td>$adr1</td><td>$adr2</td><td>$phone</td><td>$comm</td></tr>"; } $sql = "DELETE FROM $tb where fam_id = $item"; $result = mysql_query($sql, $conn) or die(mysql_error()); } echo "</table><br><br></font>"; } $sql = "SELECT * FROM $tb"; $result = mysql_query($sql, $conn) or die(mysql_error()); echo "<font color=\"blue\"><h2>Current Records on $tb database</h2></font>"; echo "<table border=1><tr><td>Selected</td><td>Record#</td><td>First Name </td><td>Last Name</td><td>Address Line1</td><td>Address Line2</td><td>Phone#</td><td>Comments</td></tr>"; while($newArray = mysql_fetch_array($result)) { $recno = $newArray['fam_id']; $fname = $newArray['fam_fname']; $lname = $newArray['fam_lname']; $adr1 = $newArray['fam_address1']; $adr2 = $newArray['fam_address2']; $phone = $newArray['fam_phone']; $comm = $newArray['fam_comments']; echo "<tr><td><input type=\"checkbox\" value=\"".$recno."\" name=\"recs[]\"></td><td>$recno</td><td>$fname</td><td>$lname</td><td>$adr1</td><td>$adr2</td><td>$phone</td><td>$comm</td></tr>"; } echo "<th colspan=\"8\" align=\"center\"><INPUT TYPE=\"submit\" value=\"submit\" name=\"submit\"></th>"; echo "</FORM>"; echo "</table>"; echo "<P><a href=\"getchoice.php\">Return to Main Menu</></P>"; } function ViewRecords($tb){ $conn =mysql_connect("localhost", "test", "user"); //pick the database to connect mysql_select_db("contacts",$conn); //create the SQL statement $sql = "SELECT * FROM $tb"; //execute the statement $result = mysql_query($sql, $conn) or die(mysql_error()); //go through each row in the result set and display data echo "<table border=1><tr><td>Record#</td><td>First Name </td><td>Last Name</td><td>Address Line1</td><td>Address Line2</td><td>Phone#</td><td>Comments</td></tr>"; switch($tb){ case 'family' : while($newArray = mysql_fetch_array($result)) { //give a name to the fields $recno = $newArray['fam_id']; $fname = $newArray['fam_fname']; $lname = $newArray['fam_lname']; $adr1 = $newArray['fam_address1']; $adr2 = $newArray['fam_address2']; $phone = $newArray['fam_phone']; $comm = $newArray['fam_comments']; echo "<tr><td>$recno</td><td>$fname</td><td>$lname</td><td>$adr1</td><td>$adr2</td><td>$phone</td><td>$comm</td></tr>"; } break; case 'friends' : while($newArray = mysql_fetch_array($result)) { //give a name to the fields $recno = $newArray['fr_id']; $fname = $newArray['fr_fname']; $lname = $newArray['fr_lname']; $adr1 = $newArray['fr_address1']; $adr2 = $newArray['fr_address2']; $phone = $newArray['fr_phone']; $comm = $newArray['fr_comments']; echo "<tr><td>$recno</td><td>$fname</td><td>$lname</td><td>$adr1</td><td>$adr2</td><td>$phone</td><td>$comm</td></tr>"; } break; case 'work' : while($newArray = mysql_fetch_array($result)) { //give a name to the fields $recno = $newArray['wr_id']; $fname = $newArray['wr_fname']; $lname = $newArray['wr_lname']; $adr1 = $newArray['wr_address1']; $adr2 = $newArray['wr_address2']; $phone = $newArray['wr_phone']; $comm = $newArray['wr_comments']; echo "<tr><td>$recno</td><td>$fname</td><td>$lname</td><td>$adr1</td><td>$adr2</td><td>$phone</td><td>$comm</td></tr>"; } break; } echo "</table>"; echo "<P><a href=\"getchoice.php\">Return to Main Menu</></P>"; } php?> |
|
[root@lintush
html]# chmod 755 * |

| Message posted on Sunday, December 9, 2007 at 09:40:10 pm By: Jesse | |
|---|---|
| No picture Available | Sorry about the double spacing. I just had a hard time getting this stuff to stay in single line. I will correct it as I have time. |
| Message posted on Tuesday, December 18, 2007 at 10:04:38 pm By: Jesse | |
| No picture Available | Finally got around to fix the double spacing. |