SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Select Help..rowname1 = $var1 and rowname1 = $var2
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

pjb2u
Starting Member

1 Posts

Posted - 05/13/2013 :  09:40:15  Show Profile  Reply with Quote
Currently I am using:

$query_rsSearchOrigin = "SELECT * FROM holidays WHERE country = '$origin'";
$rsSearchOrigin = mysql_query($query_rsSearchOrigin) or die(mysql_error());
$row_rsSearchOrigin = mysql_fetch_assoc($rsSearchOrigin);
$totalRows_rsSearchOrigin = mysql_num_rows($rsSearchOrigin);	

$query_rsSearchDestination = "SELECT * FROM holidays WHERE country = '$destination'";
$rsSearchDestination = mysql_query($query_rsSearchDestination) or die(mysql_error());
$row_rsSearchDestination = mysql_fetch_assoc($rsSearchDestination);
$totalRows_rsSearchDestination = mysql_num_rows($rsSearchDestination);	


I want this to happen ideally:

$query_rsSearchOrigin = "SELECT * FROM holidays WHERE country = '$origin' AND country = '$destination'";


Please help?

Thanks!

James K
Flowing Fount of Yak Knowledge

3326 Posts

Posted - 05/13/2013 :  10:26:40  Show Profile  Reply with Quote
If you are using MySQL, this may not be the appropriate forum - this forum is for Microsoft SQL Server. You would likely get faster and better responses at a MySQL forum.

My guess is that you need an OR condition rather than AND if you are looking for holidays in the origin country or the destination country
$query_rsSearchOrigin = "SELECT * FROM holidays WHERE country = '$origin' OR country = '$destination'";
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000