Beginner MySQL Question: Retrieving one record

markstylesx_at_yahoo.com
Date: 02/23/05


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];



Relevant Pages

  • Re: Newbie help
    ... think I can probably get what I need using SQL Server (the ... > To efficiently store and retrieve data for your needs, ... You only store changed values (as ...
    (microsoft.public.sqlserver.programming)
  • Re: Simulink store/retrieve values during simulation
    ... Is there really no way that you can store and retrieve data values during a simulink simulation like you can do with a written loop in an standard m-file? ... or in the signal processing blockset look at the buffer or delay line blocks. ...
    (comp.soft-sys.matlab)
  • C#, ADO.NET and MS-SQL
    ... 1.Enter/Select Ledger ... retrieve matching Ledgers. ... Store all Supplier details - not practical? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Storing large number of values in 2D array
    ... array.How can I store them and retrieve them later? ... Some sort of sparse array representation is just about mandatory. ...
    (comp.lang.c)
  • Re: Save ip address into DB
    ... The function with wich i retrieve the address is below this message. ... I would leave it as is and store it intact. ... And searching on an INT will be much faster than searching on a VARCHAR. ...
    (comp.lang.php)