Jump to content


Photo

join two querys together.


  • Please log in to reply
2 replies to this topic

#1 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 05 May 2006 - 08:21 PM

advance thank you.

how to join them together cheers.


How to join


$db=mysql_connect("localhost" ,"xxx","xxx");
mysql_select_db("promotor",$db);
$query="SELECT member_info.name,member_info.password,member_info.level from member_info WHERE name='$name' AND 
password='$password'and level='promoting_member'";
$result=mysql_query($query);


To this one


$query="SELECT booking_member.name,booking_member.password,booking_member.level from booking_member WHERE name='$name' and 

password='$password' and level='booking_member'";
$result=mysql_query($query);


Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 05 May 2006 - 09:06 PM

This is the full code i can not get the second select statement to work so i ask for a join but i dont think that will help.

Have any idears cheers.

If a user has an account as booking member they go to there page.

and if a user has a account promoting_member they goto there page.

The code works when the code is seprated, but i need to use it with one login form any iders please cheers.

<? session_start();

if($name && $password) {


$db=mysql_connect("localhost" ,"xxx","xxx");
mysql_select_db("promotor",$db);

$query="SELECT booking_member.name,booking_member.password,booking_member.level from booking_member WHERE name='$name' and 

password='$password' and level='booking_member'";
$result=mysql_query($query);



if(mysql_num_rows($result) == 1){

$name=$name;


session_register('name');



header("location: booking_main_page.php");
exit;

}

}else if ($name || password) {

echo "sorry please use all the form and correct password";
exit;
}

if (mysql_num_rows($result) <= 0) {

echo "sorry no account with this members/booking username and password please register";
exit;
}

if($name && $password) {


$query="SELECT member_info.name,member_info.password,member_info.level from member_info WHERE name='$name' AND 
password='$password'and level='promoting_member'";
$result=mysql_query($query);



if(mysql_num_rows($result) == 1){

$name=$name;


session_register('name');



header("location: members_main_page.php");
exit;

}

}else if ($name || password) {

echo "sorry please use all the form and correct password";
exit;
}

if (mysql_num_rows($result) <= 0) {

echo "sorry no account with this members/booking username and password please register";
exit;
}
?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 06 May 2006 - 05:16 AM

[!--sizeo:5--][span style=\"font-size:18pt;line-height:100%\"][!--/sizeo--]solved[!--sizec--][/span][!--/sizec--]
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users