Jump to content

Canman2005

Members
  • Posts

    669
  • Joined

  • Last visited

    Never

Posts posted by Canman2005

  1. Hi all

     

    I have a HTML form which has the following fields

     

    <input id="txtRow1" name="txtRow1" type="text">
    <input id="txtRow2" name="txtRow2" type="text">
    <input id="txtRow3" name="txtRow3" type="text">
    <input id="txtRow4" name="txtRow4" type="text">

     

    as you can see, the name of the field is "txtRow" followed by a number

     

    some of my pages have just 2 of the above fields and some pages have up to 45 (so going from "txtRow1" to "txtRow45").

     

    When the form is submitted, I want to run a query for each textfield that exists.

     

    I was going to initally do

     

    if($_POST['txtRow1'] != '')
    {
    }
    if($_POST['txtRow2'] != '')
    {
    }
    if($_POST['txtRow3'] != '')
    {
    }

     

    and so on, but I think that might make my page really long and going forward some pages could have up to 120 of these textfields.

     

    Is there an easy way to do this?

     

    Hope I make some kind of sense

     

    thanks in advance everyone

     

    dave

  2. Hi all

     

    I found this super cool script

     

    http://www.mredkj.com/tutorials/tableaddrow.html

     

    instead of a button called "add" I have replaced it with

     

    <select name="" onChange="addRowToTable();">
      <option value="111">111</option>
      <option value="222">222</option>
      <option value="333">333</option>
    </select>

     

    so that when you select something from the menu, it inserts a new row for you.

     

    My question is.

     

    How can I carry the value from the menu to the new row?

     

    So for example, if I selected the menu item "222", it would carry over and  insert "222" into the new row added.

     

    Is that possible and if so, can anyone help please?

     

    Thanks in advance

     

    Dave

  3. Hi all

     

    I have a List/Menu which looks lik

     

    <select name="users1[]" id="users1[]" multiple="multiple">
    <option value="Dolor">Dolor</option>
    <option value="Donec">Donec</option>
    <option value="Integer">Integer</option>
    <option value="Lacus">Lacus</option>
    <option value="Leo">Leo</option
    </select>

     

    Is it possible to use

    foreach($_POST['users1'] as $d)

    on all items in the List/Menu, despite if they have been selected or not?

     

    thanks in advance

     

    ed

  4. Hi all

     

    I have a database table that has a field called `date`, the field is in the format YYYY-MM-DD

     

    How could I write a query which would select all rows happening this week, so if today was a Tues, it would grab

     

    Tues, Wed, Thurs, Fri, Sat, Sun

     

    and if it was a Fri it would grab

     

    Fri, Sat, Sun

     

    Thanks very much everyone

     

    Dave

  5. The code is

     

    $sql = "SELECT * FROM `users` WHERE `live` = '0' ORDER BY `fname` ASC";
    $show = @mysql_query($sql, $connection) or die(mysql_error());
    while ($row = mysql_fetch_array($show))
    {
    }

     

    There is around 1,800 records and I load that much data on one page as I need it for a report im doing.

     

    Do you think its just overloading the server?

     

    I was simply doing a LIMIT to see if I could find the point at where there is an issue and then I may have been able to nail it down to a particular record in the database

  6. Hi all

     

    I have something wierd happening.

     

    I have a standard QUERY

     

    SELECT * FROM `users` WHERE `live` = '0' ORDER BY `fname` ASC

     

    but this seems to cause my page an Internal Server Error

     

    If I adjust that QUERY to

     

    SELECT * FROM `users` WHERE `live` = '0' ORDER BY `fname` ASC LIMIT 980

     

    then it runs the page fine and no Internal Server Error

     

    DOes anyone know why this might be happening?

     

    THanks in advance

     

    Dave

  7. Hi

     

    Sorry, I know this is most likely in the wrong forum group, but im not sure if any freelancers are looking in the freelancer job forum board.

     

    I'm in urgent need of a good php freelancer who can do work this weekend to help sort out a drupal shopping cart.

     

    If you can, please let me know on this message or PM me

     

    And sorry again if this is in the wrong group, I just don't think many people look at the freelancer group

     

    thanks

  8. Hi all

     

    I have a bunch of records which have a date field `datecreated` next to each one, so for example

     

    2003-09-28

     

    these are dates that products are built (manufactor)

     

    I want to do a QUERY which would grab all records that the date of manufactor was between x and y years.

     

    So grab all records which have a manufactor date of between 10 and 15 years old

     

    Is that possible or should I store the date next to each item?

     

    Thanks so much everyone

     

    Dave

×
×
  • 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.