Jump to content

mc136

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Posts posted by mc136

  1. hi servicedesk and status represent sections (headings) and for each i need to be able to enter approp info

    i.e. servicedesk contains sub directory batch, promo and these contain the values whatever 6, 7, etc

     

    e.g. Servicedesk

              batch - 8

              promo - 2

     

          status

              fmr - 3

              odw - 5

     

  2. Hi I seem to manage to produce the info i need when not using a database. Being new to mysql could someone help in telling me how i should enter the following data into db.

     

    $section['servicedesk']['batch'] = 8;

    $section['servicedesk']['promo'] = 22;

    $section['servicedesk']['ens'] = 2;

    $section['status']['fmr'] = 16.00;

    $section['status']['odw'] = 16.00;

     

    print_r ($section);

     

    returns the following:

     

    Array ( [servicedesk] => Array ( [batch] => 8 [promo] => 22 [ens] => 2 ) [status] => Array ( [fmr] => 16 [odw] => 16 ) )

  3. Hi thanks but when I run it it deleted oe of the columns (no big deal).

    Need i do anything with the formpart <input.....>

     

    $check = $_POST[$value_of_parent['qName']][$key_of_child]

     

    cheers

  4. Have used the following code but when coming to create the form i'm stuck as to what

    to put into the S_POST

     

    e.g. have tried $check = $_POST[$value_of_parent['qName'] . $key_of_child]

    but this will not post anything to the database. Please help

     

     

    echo "<td><input type='text' name='" . $value_of_parent['qName'] . "[" . $key_of_child . "]' size='1'></td>";

  5. Hi I have the following piece of code which enters all data into a table and if all data entered will show green image or blue (and text box) if not. My problem is with creating a form basically don't know where to start. Ive tried but will only update the last text box. Any help please!! ???

     

    while($Array = mysql_fetch_array($result, MYSQL_ASSOC)){

    $arr[] = $Array;

    }

     

    echo "<pre style=\"text-align: left; font-size: 10px;\">";

      print_r( $arr );

    echo "</pre>";

     

    foreach($arr as $key => $value){

    echo "<tr><td><H1>" . $value['qName'] . "</td>";

     

    foreach($value as $chk => $num){

    if(preg_match("/^chk/",$chk) && $num >= "0"){

    echo "<td><p>" . $num . "</td>";

    }elseif(preg_match("/^chk/",$chk) && $num == ""){

    echo "<td><input type='text' name='check1' size='1'></td>";

    }

    }

     

    //----------test-works---------

     

    if($value[chk1] == ""){

    print "<td align='center'><img src=\"blue.jpg\" width=\"15\" height=\"15\" alt=\"description of the photo\"></img></td>";

    }elseif($value[chk2] == ""){

    print "<td align='center'><img src=\"blue.jpg\" width=\"15\" height=\"15\" alt=\"description of the photo\"></img></td>";

    }else{

    print "<td align='center'><img src=\"green.jpg\" width=\"15\" height=\"15\" alt=\"description of the photo\"></img></td>";

    }

            //----------end test------

    }

  6. hi

     

    I have a table which pulls back info from db and populates table. I would like input boxes at the end of the rows to be able to input new data and then for the input boxes to move to the next column once the info has been entered.

    e.g.

    qName        chk1    chk2    chk3    chk4      chk5

    name1          8          7        3      input box

    name2          23        5        1      input box

     

    Currently pull back all info from db then have it print as follows:

     

      print "<tr><td><H1>{$Array[qName]}</td>

                  <td align='center'><p>{$Array[chk1]} </td>

          <td align='center'><p>{$Array[chk2]} </td>

          </tr>";

     

    Can i maybe expand on this to include the input boxes??

    Any help would be grateful

    chears

    mc

  7. note to self:
    To do this, you should use mysql_fetch_array, or in many cases, mysql_fetch_assoc.  The first one obtains an array where you can either use the column name, or a row number.  Since I don't think in numbers, I use the second one, which only obtains an array of the column names.  More info:
  8. thanks for the input. when trying this it pulls back what is in the row (nice to know) but i need something simpler to pull back the field names first i.e.
    Date:  Name
    then to pull back the rows under each column (thanks).

    cheers
    mc136

    will check out your site also andlet you know
  9. Hi guys

    brand new to php. Ive created a mysql database containing fields e.g. name, description etc.
    Question is how can I display these fields using loop system. Currently using :
    foreach (array("name", "description") as $v) {
        echo "$v\n";
    }
    would much prefer to query the database and pull back this info.

    Rgds
    mc136
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.