redarrow Posted May 5, 2006 Share Posted May 5, 2006 advance thank you.how to join them together cheers.How to join[code]$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);[/code]To this one[code]$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);[/code] Quote Link to comment https://forums.phpfreaks.com/topic/9155-join-two-querys-together/ Share on other sites More sharing options...
redarrow Posted May 5, 2006 Author Share Posted May 5, 2006 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.[code]<? 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;}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/9155-join-two-querys-together/#findComment-33738 Share on other sites More sharing options...
redarrow Posted May 6, 2006 Author Share Posted May 6, 2006 [!--sizeo:5--][span style=\"font-size:18pt;line-height:100%\"][!--/sizeo--]solved[!--sizec--][/span][!--/sizec--] Quote Link to comment https://forums.phpfreaks.com/topic/9155-join-two-querys-together/#findComment-33796 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.