Click to See Complete Forum and Search --> : retrieving value


zuzupus
07-04-2003, 06:33 AM
hi,
i got one problem regarding getting value from database specially one particular field

in my table i have Nr. as primary key ,another field is text
$query = "SELECT text from emp_details ";
$result = mysql_query($query) or die("Query failed: $query");

//retrieving value from database and displaying in client side
<input size="1" type="text" name="text" value="<?= $query["text"] ?>" readonly>

thisone si not working anyone please help me out to get the value as i am getting empty field everytime i login

thanks in advance

Khalid Ali
07-04-2003, 09:32 AM
I am no PHP expert at all..:D
just lookinga t your code I think you should do it this way

<input size="1" type="text" name="text" value="<?= $result["text"] ?>" readonly>

because query seems just a string where as $result is the one that has the query results in it..:-)

I really hope this helps..:D :D

zuzupus
07-04-2003, 09:49 AM
thanks but i did mistake i have to use $result=msql_fetch_array ($query) then i have to retrieve thanks alot anyway:)