hi ,,,,,
I have a problem in the following code ...
The following code works as follows displays the invites for each member so that if he had five invite from supposed to be displayed all on one page
But before you code that does not function Proper
image is the only display one invite on the page and until the approval or rejection of the invitation displays the invite the other ....
But this is not my want to offer all on one page
I wish I could solve the problem and I can view all calls in one page
I think that the problem is in the order code
I think that the problem is in the order code
my code :
<?php
session_start();
if (!isset($_SESSION['user_id']))
{
header("Location: login.php");
}
$id=$_SESSION['user_id'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<center>
<?php
include("connect.php");
$sql =mysql_query("select * from ninvite where recieverMemberID ='$id' and viwed= '0'");
$num =mysql_num_rows($sql);
echo $num ;
if ($num>0)
{
while($row=mysql_fetch_array($sql))
{
$sender=$row['SenderMemberID'];
$room=$row['RoomID'];
$sql =mysql_query("select MemberName from members where MemberID ='$sender' ");
$sql1 =mysql_query("select RoomName from rooms where RoomID ='$room' ");
while($row=mysql_fetch_array($sql))
{$mem =$row['MemberName'];
}
while($rows=mysql_fetch_array($sql1))
{ $Ro =$rows['RoomName'];
?>
<form action="join.php" method="post">
<label>
</label> <br/>
<label> <?php echo " you have invite from $mem to join $Ro"; ?> </label>
<br/><br/>
<label>accept</label>
<input name="radio1" type="
radio" value="accpet" />
<label>reject</label>
<input name="radio1" type="
radio" value="Reject" /><br/>
<input type="submit" name="submit" value="done" />
</form>
<?php } } } ?>
</center>
</body>
</html>
thanks alot.
my SQl
-- phpMyAdmin SQL Dump
-- version 3.2.4
-- http://www.phpmyadmin.net
-- Host: localhost
-- Generation Time: May 07, 2010 at 12:50 ?
-- Server version: 5.1.41
-- PHP Version: 5.3.1
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT /;
/!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS /;
/!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION /;
/!40101 SET NAMES utf8 */;
--
-- Database: tr
--
-- Table structure for table joinroom
CREATE TABLE IF NOT EXISTS joinroom (
MemberID int(10) NOT NULL,
RoomID int(10) NOT NULL,
PRIMARY KEY (MemberID,RoomID)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table joinroom
INSERT INTO joinroom (MemberID, RoomID) VALUES
(28, 1);
--
-- Table structure for table members
CREATE TABLE IF NOT EXISTS members (
MemberID int(10) unsigned NOT NULL AUTO_INCREMENT,
MemberName varchar(20) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
MemberPass varchar(10) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
MemberEmail varchar(30) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
MemberLocation text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
MemberImg text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
PRIMARY KEY (MemberID)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=34 ;
--
-- Dumping data for table members
INSERT INTO members (MemberID, MemberName, MemberPass, MemberEmail, MemberLocation, MemberImg) VALUES
(28, 'marwa', '1234', '
[email protected]', 'mmmmmm', 'dddddddddd'),
(29, 'nora', '1234', '
[email protected]', 'fffffffffffgg', 'gggggggggggggg'),
(30, 'soso', '1234', '
[email protected]', 'ffffffff', 'kkkkkkkkkkkkkkkkkk'),
(31, 'gege', '1234', '
[email protected]', 'kkkkkkkkkkkkkkkk', 'uuuuuuuuuuuuuuuuu'),
(32, 'nono', '1234', '
[email protected]', 'ggggggggggggaaaaa', 'aaaaaaaaaaaaaaa'),
(33, 'nda', '1234', '
[email protected]', 'kkkkkkkkkkkkkkkk', 'ooooooooooooooo');
--
-- Table structure for table ninvite
CREATE TABLE IF NOT EXISTS ninvite (
SenderMemberID int(11) NOT NULL AUTO_INCREMENT,
recieverMemberID varchar(30) NOT NULL,
RoomID int(11) NOT NULL,
viwed int(11) NOT NULL,
PRIMARY KEY (SenderMemberID,recieverMemberID,RoomID)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=33 ;
--
-- Dumping data for table ninvite
INSERT INTO ninvite (SenderMemberID, recieverMemberID, RoomID, viwed) VALUES
(28, '33', 1, 0),
(28, '32', 1, 0),
(28, '31', 1, 0);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT /;
/!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS /;
/!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;