Hello All!
I was wondering if any of you guys could help me with a small problem I'm having!
I'm trying to add a select list to a form on my webpage.
The select list is generated from information stored in a database.
The table has 25 rows in it presently and what I'm trying to do is list only one column of the rows to create a select list.
An example of this:
Populating a select list with all of the names in a member database.
Here is the relevant code:
$ReqQry=" SELECT `traitname` FROM `traitslist` ";
$ReqResult= mysqli_query($cxn , $ReqQry)or die('Ya did it wrong');
$TraitInfo= mysqli_fetch_assoc($ReqResult);
$TraitCnt= mysqli_num_rows($ReqResult);
$list1=$TraitCnt;
echo "Required Skill 1-"."</br>";
echo "<select id='Req1'>";
foreach($TraitInfo as $v)
{
while($list1 > 0)
{
echo "<option value='$v'>$v</option>";
$list1--;
}
}
echo "</select>"."</br></br>";
The problem that I am having is that the select list generates the same entry 25 times.
Any help would be appreciated, as I have fiddled around with it for about two days in my off-time and no luck yet. Thanks
*ps* I'm still rather wet behind the ears with PhP so be gentle
I think i'm using the syntax incorrectly
Hi Everyone!I'm new to this forum and a newbie with PHP - I'm glad I found this site - I hope to learn a lot! For my first and hopefully one of few questions, lol..I told my boss i'd help him out
php not working written for consumption of slots
1. Here is the function where i will be allowed to consume the slot booked by me.2. Here i check the unique reservation id, current server time & date.3. Then i ask the user to enter the
Sessions Value Not Saved
Hi,Im making a login form and im using this code:Code: if($login=="true"){$_SESSION['mlvl']=1;if($username=="admin"){$_SESSION['admin']=1;}else{$_SESSION['admin']=0;}}but when the
PHP hyperlinks generator
HiI need some help to get this done using php:1 - I have few hyperlinks say 500 in format like:<a href="http://domaina.com/1.html"
Help me with some material on Open Text Overview.
Hi Experts,
how to remove in php string display
My code is
writing my own sobel filter convolution - something is wrong
I am trying to keep it very simple, I cant see anything wrong with my logic, could anybody help point me to the right direction?!! Code: { int Shorizontal[] = {-1, 0, 1, -2, 0, 2, -1, 0, 1}; int
Supress some serveroutput but not all
Hi,
PHP Cannot redeclare class
I have 6 files, and two of them do not seem to want to play well. I keep getting a "Cannot redeclare class" error.** edit **I know its these 2 files, because when i comment out the
Why does my crawler script suddenly end with no error?
Hi.I have written a web crawler script. It will visit a large number of URL's with cURL.After around 2-3 minutes of running, it will just stop, with no error output or notices.I have these