Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

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

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

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?


James K
Flowing Fount of Yak Knowledge

3873 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  
 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.39 seconds. Powered By: Snitz Forums 2000