PHP form question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • phatnugs420@comcast.net

    #1

    PHP form question

    I was wondering if there was an easy way to show information in a form? I've
    tried a variety of things, and I'm sure I'm doing something wrong, or just
    don't know what I'm doing.. :) could be both! Anyway basically I want to be
    able to edit information from a mysql db, but when they go to the edit page
    I want the form that I need to edit to show the information from mysql in
    the form itself.. One of the examples I have tried is:


    $query = mysql_query("SE LECT * FROM itltest WHERE jobnum='$jobnum ' AND
    custID='$custID '") or die (mysql_error()) ;
    while ($row = mysql_fetch_ass oc($query)) {

    ?>

    <input name="company" type="text" id="company" value="<? echo "$company"? >">



    Thanks in advance!

  • jrf[no]

    #2
    Re: PHP form question

    phatnugs420@com cast.net wrote:
    [color=blue]
    > I was wondering if there was an easy way to show information in a form? I've
    > tried a variety of things, and I'm sure I'm doing something wrong, or just
    > don't know what I'm doing.. :) could be both! Anyway basically I want to be
    > able to edit information from a mysql db, but when they go to the edit page
    > I want the form that I need to edit to show the information from mysql in
    > the form itself.. One of the examples I have tried is:
    >
    >
    > $query = mysql_query("SE LECT * FROM itltest WHERE jobnum='$jobnum ' AND
    > custID='$custID '") or die (mysql_error()) ;
    > while ($row = mysql_fetch_ass oc($query)) {[/color]

    ADD THIS HERE:
    $company = $row['company'];

    [color=blue]
    >
    > ?>
    >
    > <input name="company" type="text" id="company" value="<? echo "$company"? >">
    >
    >
    >
    > Thanks in advance!
    >[/color]

    Comment

    • Michael Fesser

      #3
      Re: PHP form question

      .oO(phatnugs420 @comcast.net)
      [color=blue]
      > $query = mysql_query("SE LECT * FROM itltest WHERE jobnum='$jobnum ' AND
      >custID='$custI D'") or die (mysql_error()) ;
      > while ($row = mysql_fetch_ass oc($query)) {[/color]

      Are $jobnum and $custID numeric? If yes remove the single-quotes around
      them. Only strings have to be quoted.

      Micha

      Comment

      • Colin McKinnon

        #4
        Re: PHP form question

        Michael Fesser wrote:
        [color=blue][color=green]
        >> $query = mysql_query("SE LECT * FROM itltest WHERE jobnum='$jobnum ' AND
        >>custID='$cust ID'") or die (mysql_error()) ;
        >> while ($row = mysql_fetch_ass oc($query)) {[/color]
        >
        > Are $jobnum and $custID numeric? If yes remove the single-quotes around
        > them. Only strings have to be quoted.
        >[/color]

        Query will work with quotes round numbers - but MySQL may have problems
        optimising the query.

        C.

        Comment

        • Mikey P

          #5
          Re: PHP form question

          Sometimes i feel so dumb.. :) Thanks so much, this worked perfectly! you rock... :)

          Mikey P


          "jrf[no]" <"jrf[no]"@[spam]jokeaday.net> wrote in message news:<41772feb$ 0$61766$abc4f4c 3@news.wanadoo. nl>...[color=blue]
          > phatnugs420@com cast.net wrote:
          >[color=green]
          > > I was wondering if there was an easy way to show information in a form? I've
          > > tried a variety of things, and I'm sure I'm doing something wrong, or just
          > > don't know what I'm doing.. :) could be both! Anyway basically I want to be
          > > able to edit information from a mysql db, but when they go to the edit page
          > > I want the form that I need to edit to show the information from mysql in
          > > the form itself.. One of the examples I have tried is:
          > >
          > >
          > > $query = mysql_query("SE LECT * FROM itltest WHERE jobnum='$jobnum ' AND
          > > custID='$custID '") or die (mysql_error()) ;
          > > while ($row = mysql_fetch_ass oc($query)) {[/color]
          >
          > ADD THIS HERE:
          > $company = $row['company'];
          >
          >[color=green]
          > >
          > > ?>
          > >
          > > <input name="company" type="text" id="company" value="<? echo "$company"? >">
          > >
          > >
          > >
          > > Thanks in advance!
          > >[/color][/color]

          Comment

          Working...