Pl. try like this:
<?php
include 'dbc.php';
echo '<select name="categories" >';
$res=mysql_ query("select * from missionary") ;
if(mysql_num_ rows($res) ==0) echo "there is no data in table..";
else
while($row=mysql_
{
echo "<option>".$
}
echo'</select> ';
?>
____________
From: Reid <reidsim@gmail.
To: PHP_MySQL_usergroup
Sent: Wednesday, 8 July, 2009 7:49:02 PM
Subject: Re: [PHP_MySQL] Need help with combo
I tried that and it did not work. There is no error msg but when I look at
combo and click on it. It has many 0's and there is no first or last name.
If I change back to old code like
// $both['full_ name'] = ($row['first_ name']) + ' ' + ($row['last_ name']);
// echo"<option> $both[full_ name]</option> ";
echo"<option> $row[first_ name]</option> ";
This one is working only for first name. I am trying to add the last name on
it. Because some of them have same first name. I want to add last name so I
can select the right person.
Reid
On Wed, Jul 8, 2009 at 2:58 AM, James Lamb <james@jalamb. f9.co.uk> wrote:
>
>
> It would be helpful if you said what sort of error/problem you had,
> but I think you need quotes around the parameters in $row, so:
>
> $both['full_ name'] = ($row['first_ name']) + ' ' + ($row['last_ name']);
>
> otherwise they are just variables which have unset values.
>
> James
>
> At 03:39 08/07/2009, you wrote:
> >I am trying to figure out how to get two columns into one combo. I
> >have two columns. One column for first name and other columns for
> >last name. I want first and last name in one combo. Here is my
> >codes. Can someone tell me what went wrong?
> >
> ><?php
> >include 'dbc.php';
> >
> >echo'<select name="categories" >';
> >$res=mysql_ query("select * from missionary") ;
> >if(mysql_num_ rows($res) ==0) echo "there is no data in table..";
> >else
> >for($i=0;$i< mysql_num_ rows($res) ;$i++) {
> >$row=mysql_ fetch_assoc( $res);
> >
> >$both[full_ name] = ($row[first_ name]) + ' ' + ($row[last_name] );
> >
> >echo"<option> $both[full_ name]</option> ";
> >
> >}
> >echo'</select> ';
> >
> >?>
> >
> >
> >
> >----------- --------- --------- -------
> >
> >----------- --------- --------- --------- ----
> >
> >Come to the monthly meetings at UTD in Richardson, TX.
> >Second Tuesday of every month.Yahoo! Groups Links
> >
> >
> >
> --
> James Lamb
>
>
>
[Non-text portions of this message have been removed]
Yahoo! recommends that you upgrade to the new and safer Internet Explorer 8. http://downloads.
[Non-text portions of this message have been removed]
Come to the monthly meetings at UTD in Richardson, TX.
Second Tuesday of every month.
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch format to Traditional
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
0 Comments:
Post a Comment