Sun Jun 01, 2008 11:40 am
<? session_start();?>
<html>
<link rel="stylesheet" href="my_layout.css" type="text/css" />
<title>Phone Book Project</title>
<body class="my_body">
<div id="my_divition">
<?php
include('Control.php');
$connect=mysql_connect ("localhost", "root", "");
mysql_select_db ("phonebook");
$fname=$_POST['fname'];
$lname=$_POST['lname'];
$id=$_SESSION['id'];
$sqlQuery="select * from contact where f_name='$fname' AND l_name='$lname' AND M_id='$id'";
$result=mysql_query($sqlQuery);
$number=mysql_num_rows($result);
echo "<b><u><br>The search result is : </u></b><br><br>";
echo "<table border=1> ";
echo "<tr><th>First name</th><th>Last name</th>
<th>Phone number</th></tr>";
if($number>0)
{
$fname=mysql_result($result,$number-1,"f_name");
$lname=mysql_result($result,$number-1,"l_name");
$phone=mysql_result($result,$number-1,"phone_number");
echo "<center><tr><th>$fname</th><th>$lname</th>
<th>$phone</th></tr></center>";
$number--;
}
else
{
echo "</table> <br/> Sorry :no contact found with Name=$fname $lname ! ";
}
?>
</div>
</body>
</html>
-- Server version: 4.1.9
-- PHP Version: 4.3.10
--
-- Database: `phonebook`
--
-- --------------------------------------------------------
--
-- Table structure for table `contact`
--
CREATE TABLE `contact` (
`C_id` int(4) NOT NULL auto_increment,
`f_name` varchar(10) NOT NULL default '',
`l_name` varchar(10) NOT NULL default '',
`phone_number` varchar(15) NOT NULL default '',
`M_id` int(4) NOT NULL default '0',
PRIMARY KEY (`C_id`),
KEY `M_id` (`M_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=21 ;
--
-- Dumping data for table `contact`
--
INSERT INTO `contact` VALUES (17, 'rwer', 'eqwr', '342355', 1);
INSERT INTO `contact` VALUES (16, 'sss', 'sss', 'fff', 1);
INSERT INTO `contact` VALUES (18, 'eee', 'qqq', '123345', 1);
INSERT INTO `contact` VALUES (19, 'eee', 'qqq', '123345', 1);
INSERT INTO `contact` VALUES (20, 'eee', 'qqq', '123345', 1);
-- --------------------------------------------------------
--
-- Table structure for table `members`
--
CREATE TABLE `members` (
`id` int(4) NOT NULL auto_increment,
`username` varchar(10) NOT NULL default '',
`pass` varchar(10) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
--
-- Dumping data for table `members`
--
INSERT INTO `members` VALUES (1, 'msi_333', '11991199');
INSERT INTO `members` VALUES (2, 'msi_333', '11991199');
INSERT INTO `members` VALUES (3, 'mmm', '11991199');
INSERT INTO `members` VALUES (4, '', '');
Sun Jun 01, 2008 1:48 pm
Sun Jun 01, 2008 2:05 pm
Mon Sep 01, 2008 11:37 am
Tue Sep 02, 2008 2:11 pm
strandcentury wrote:in the package there is no sql file for the mysql database - how to I set up the database without the sql file, since I do not know the database structure. Please help!
Wed Nov 05, 2008 12:25 pm
Wed Jan 14, 2009 4:11 am
Thu Jan 15, 2009 12:04 am
Thu Jan 22, 2009 10:11 pm
Thu Jan 22, 2009 10:26 pm
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.