/    Sign up×
Community /Pin to ProfileBookmark

retrieving value

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

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliJul 04.2003 — I am no PHP expert at all..?

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..? ?
Copy linkTweet thisAlerts:
@zuzupusauthorJul 04.2003 — thanks but i did mistake i have to use $result=msql_fetch_array ($query) then i have to retrieve thanks alot anyway?
×

Success!

Help @zuzupus spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...