Jump to content

Pomtom44

New Members
  • Posts

    8
  • Joined

  • Last visited

Posts posted by Pomtom44

  1. Most of that went right over the top of my head sorry.
    I do have a auto assigned ID value in there as well (I thought that was just standard practise so I didnt mention it)

    As for count() I had a look but couldnt figure out how to get it to display the most hit result rather than how many times a certain value was entered

  2. Hey all.

    Kinda new to PHP and MySql so please be gentle :P haha

    Im wanting to make a page which goes though my database and finds the most used word in a column then display it on screen. but with different search requests.

     

    Heres an example

     

    Database:

     

    Name:                  Entry:                       Result

    Tom                     A                              1
    Jim                       B                              2
    Tom                     A                              1
    Sam                     A                              1
    Jim                       B                              2
    Sam                     A                              3
    Sam                     B                              2 
    Tom                     A                              2

     

    What number comes up most for Tom A
    What number comes up most for Sam B
    What number comes up most for Sam A

    And so on.

     

    Hope it makes sense and hope someone can help me out  

  3. Hey everyone.
    I am farly new to PHP and MySQL so I do say sorry in advance for any stupid lines of code I have written.
    But I am stuck at a point in a website im making for a friend.

    I have a database with a unknown amount of entries.
    I have currently found a way to make a list of entries appear in a table. and add a edit button to edit each entry separately on another page
    however what I would like is a table with all the entries in so they can admin all the entries without having to go though phpmyadmin

    I know it has something to do with arrays. But i cant seem to find a simple explanation for what im wanting to do 
    So im hoping someone here can either give me a link to something that will help. or explain it to me in simple terms.

    Thanks in advance
    PomTom

    I can provide code if required from my other working pages but i figured since its a new page im making theres no code written to provide
     

  4. your not closing your form off after each loop. the </form> is missing. so you have ended up with a load of inputs with the same name (cardID) . php will be passed the last one in the form with that name

    Ah is it something really that stupidly simple. I swear both my and my friend looked over this code so many times trying to figure this out.

    I shall try it now and let you know.

    Thanks for the help btw.

     

    (How did I miss that?)

  5. Hey all.
    Im slightly new to PHP and MYSQL so sorry if my code is a mess and has "odd ways" of doing things.
    But it works for me so far and thats all that matter really isnt it?

    Anyway I have a php script that generates a table of information.
    What i would like is a Edit button for each row of that table so when pressed it will open a new page with a form where the user can update the fields for that entry.

     

    I have messed around a little bit with ideas i know from my limited HTML and PHP but can't seem to get it to work
    and not sure what to put when i google it so I cant seem to find a solution anywhere

    Currently it is sending the last ID that it loads into the table no matter what edit button you press.

     

    Here is my current code

    echo "<table border='1'>";
    echo "<tr> <th>Edit</th> <th>CardID</th> <th>Location</th> <th>Date Placed</th> <th>Found</th> <th>Date Found</th> <th>Found By</th> </tr>";
    while($row = mysql_fetch_array($cards)) {
    echo "<tr><td>"; 
    $cardID = $row['MemberCode'] . $row['CardID'];
    echo "<form action='../editcard.php' method='POST'>";
    echo "<input type='hidden' name='CardID' value='";
    echo $CardID;
    echo "'>";
    echo "<input type='Submit' value='Edit'>";
    echo "</td><td>"; 
    echo $CardID;
    echo "</td><td>"; 
    echo $row['Location'];
    echo "</td><td>";
    echo $row['DatePlaced'];
    echo "</td><td>"; 
    $found = $row['Found'];
    if ($found == 1)
    {
    echo "yes";
    }
    else
    {
    echo "no";
    }
    echo "</td><td>";
    echo $row['DateFound'];
    echo "</td><td>";
    echo $row['FoundBy'];
    echo "</td></tr>"; 
    } 
    echo "</table>";
    

    Thanks for any help in advance

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