Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with SQL statement

Status
Not open for further replies.

Bastien

Programmer
May 29, 2000
1,683
CA
select * from gulf_options where option_id in (1,2)

Warning: Supplied argument is not a valid MySQL result resource in C:\\Inetpub\\ on line 47

I am trying to find some data based on values from another query. The first query provides the \"(1,2)\" as a set of options to be found, where each number is an option_id.

What am i doing wrong?

TIA

Bastien

There are many ways to skin this cat,
but it still tastes like chicken
 
May we please see what you were trying to do in line 47? ______________________________________________________________________
Perfection in engineering does not happen when there is nothing more to add.
Rather it happens when there is nothing more to take away.
 
line 47 is the DB call

$Options = mysql_query($SQLGetOptions) or die ("Couldn't connect");

TIA

Bastien

There are many ways to skin this cat,
but it still tastes like chicken
 
Hmm, I still don't think you are giving enough information. You do realize that the mysql_query() function does not connect to the database, right?

I think you want something like:
Code:
$conn = mysql_pconnect("hostname", "username", "password") or die("Failed to connect");
@mysql_select_db("database", $conn);

$query = "SELECT * FROM gulf_options WHERE option_id IN (1,2)";
$result = mysql_query($query) or die("Failed to perform query");

What is the first query you are running? I am still somewhat unclear on what you are trying to do.

Hope this helps,
-Vic vic cherubini
krs-one@cnunited.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top