selectbox+database connection retrive problem


Posted on 16th Feb 2014 07:03 pm by admin

Code: [Select]
<tr>
<th align="left" scope="col"><span class="style2 style8">Features </span></th>
<th colspan="2" align="left" scope="col"><span class="style8">
<textarea name="features" cols="30%" rows="6"></textarea>
</span></th>
<th scope="col"><span class="style8">
<select name="select">
<?php
$query="select ID, CODE from features order by ID asc";
$result=mysql_query($query);
while(list($id, $name)=mysql_fetch_row($result)) {
echo "<option value="".$id."">".$name."</option>";
}
?>
</select>
</span></th>
</tr>


hi frds...

am using same select box in 20 different place in same php page.for these i creating database connection,executing query and value display in select box.my question is ,i want write same set of code for 20 selectbox in my php page ?if it so means,my php form load very slowly because php is creating 20 different database conection on loading page.how to solve these problem??i need to creat one connection,using that one connection i should diaplay same values,20 select box in my php page any suggestion pls..

or

query="select ID, CODE from features order by ID asc";
$result=mysql_query($query);
can i store $result in any array variable.. then i can dispaly value in select box..?? suggest pls..thanks

No comments posted yet

Your Answer:

Login to answer
310 Like 18 Dislike
Previous forums Next forums
Other forums

redirect standard error and assert (how to?)
How do you redirect standard error and assert?

---

(Why? I am creating an web app and

Problem in back link
I have page where i have given javascript back link but when i click on it browser give a message

Problems with strings containing
Hey all,

I have encountered something strange in a script. I am trying to write an XML heade

want to add a break after a certain amount of characters
i was wondering how to add a break in a blog post after a certain amount of characters... any idea o

Loosing changed contents when used FM REUSE_ALV_GRID_DISPLAY
Hi,

I have used FM REUSE_ALV_GRID_DISPLAY in my program as below.

CALL FUNCT

Parse error: syntax error, unexpected $end in
hello,
i receive the error :Parse error: syntax error, unexpected $end in C:xamppxampphtdocsh

How to submit a form to the same page?
I have a table containing information about books in my library and this table has the following col

question about stripslashes and real_escape_string
im cleaning up an old app that I wrote fixing some of the vulernabilities from attacks.

I hav

insert mysql embeded videos as blobs?
Using TinyMCE my client will be able to embed images and flash videos into large columns of text whi

foreach and array need help combining
Hi guys.

Here's the code

Code: array(
'tag' => 'code',<

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash