Beginner MySQL Question: Retrieving one record
markstylesx_at_yahoo.com
Date: 02/23/05
- Next message: Geoff Berrow: "Re: Beginner MySQL Question: Retrieving one record"
- Previous message: Marc: "Re: Create state-cty dropdown lists"
- Next in thread: Geoff Berrow: "Re: Beginner MySQL Question: Retrieving one record"
- Reply: Geoff Berrow: "Re: Beginner MySQL Question: Retrieving one record"
- Reply: Geoff Berrow: "Re: Beginner MySQL Question: Retrieving one record"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 22 Feb 2005 15:41:38 -0800
Hi, I have this SQL Query, and it does it I wanted it to do, and that
is retrieve one record and store it into an assigned value. I am just
a beginner at this, but can see it's inefficient and probably could be
shortened. I tried a few variations, but how would this be pared down?
$sql_query = "SELECT data_temp FROM records WHERE session_id =
'$passed_value'";
$result = mysql_query($sql_query,$db);
$dd = 0;
while ($row = mysql_fetch_row($result)) {
$my_value[$dd] = $row[0];
$dd++;
}
print $myvalue[0];
- Next message: Geoff Berrow: "Re: Beginner MySQL Question: Retrieving one record"
- Previous message: Marc: "Re: Create state-cty dropdown lists"
- Next in thread: Geoff Berrow: "Re: Beginner MySQL Question: Retrieving one record"
- Reply: Geoff Berrow: "Re: Beginner MySQL Question: Retrieving one record"
- Reply: Geoff Berrow: "Re: Beginner MySQL Question: Retrieving one record"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|