Jump to content

vomitbomb

Members
  • Posts

    58
  • Joined

  • Last visited

    Never

Everything posted by vomitbomb

  1. I worked out how I could put the values in the list menu like: <label>60-70 <select name="wt6070" id="wt6070"> <option value='<? echo "$wt6070" ?>' selected="selected"><? echo "$wt6070" ?></option> <option value="0">0</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> </label> Only problem is it seems to have to display a value at the bottom of the list menu. Say it has selected number 5 because the value of wt6070 is 5, 5 also appears below the 0 in the drop down menu. It's only an aesthetic thing but it's working which is cool.
  2. Yeah thats a better way to do the list menus, but it's not what I'm stuck with at the moment.
  3. I can get the values from the database and put them in the text fields like so, but I can't put values back into the List menus (they all stay the same). //Update order echo'<form action="order.php" method="post"> <input type="hidden" name="fname" value="'.$row['fname'].'" /> <input type="hidden" name="lname" value="'.$row['lname'].'" /> <input type="hidden" name="lname" value="'.$row['tb24kg'].'" /> <input type="submit" value="Update-Order" /> </form>'; and then: <label>First <input type="text" name="fname" id="fname" value='<? echo "$fname" ?>' /> </label> <label>Surname <input type="text" name="lname" id="lname" value='<? echo "$lname" ?>' /> </label> <label>2-4kg <select name="tb24kg" size="1" id="tb24kg" value='<? echo "$tb24kg" ?>'> <option value="0">0</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> </label> Anyone know why?
  4. ok I got that to work. Didn't like the include I used for all the $_POST for some reason. This only works on text menus and wont work on list menus, anyone know why?
  5. ok this works well for the first name, but not for anything else.. hmm //Update order echo'<form action="order.php" method="post"> <input type="hidden" name="fname" value="'.$row['fname'].'" /> <input type="hidden" name="lname" value="'.$row['lname'].'" /> <input type="submit" value="Update-Order" /> </form>'; and then: <label>First <input type="text" name="fname" id="fname" value='<? echo "$fname" ?>' /> </label> <label>Surname <input type="text" name="lname" id="lname" value='<? echo "$lname" ?>' /> </label> Anyone know why?
  6. function resetFields(){ var inputs = document.getElementsByTagName('input'); for(var i=0;i < inputs.length;i++){ inputs[i].value = ''; } } am I meant to be changing something there? causes an error on the second line.
  7. Cool I managed to get the value into the form, but now I can't reset the form because the value is set to $fname. :-\ <input type="text" name="fname" id="fname" value='<? echo $fname;?>'> and the reset: <input type="reset" value="Reset Fields" /> Any idea on how I can reset this?
  8. ah k I get what you're explaining, nah I need this to send this to another document. $fname = $_POST['fname']; echo $fname; echo '<label>First <input type="text" name="fname" id="fname" value="$fname"/> </label>' Ok the echo up there gives me the right information, although on this particular form it just leaves $fname instead of it's value. I've also tried value=' echo $fname; '>
  9. Ok I'm trying to figure it out, I realise it sends it to the forms, but how can I write in on the orderform so the forms get populated with these results?
  10. Is it possible to pull values from the database and put them into forms? I want to pull up a specific order and repopulate the order forms so that order can be changed or updated. Thanks.
  11. For some reason I can print out these values, but I can't delete them, do I have the DELETE syntax wrong or something? I am using basically the same code on another page using SELECT instead of DELETE and that works. $search = $_GET['search']; $searchl = $_GET['searchl']; echo $search; echo $searchl; echo "<h3>Deleting order name: $search $searchl</h3><br>"; //create a query $sql = "DELETE * FROM orders WHERE lname LIKE '$search' AND fname LIKE '$searchl'"; $result = mysql_query($sql, $conn);
  12. awesome, been trying to find the syntax for SELECT. and it's as easy as that, thanks conker!
  13. Cool it's parsing values like a champion now, next problem.. How do I use SELECT to search for 2 strings? :-\ ps. Here is the code I got working. $sql = "SELECT * FROM orders WHERE lname LIKE '$search'"; $result = mysql_query($sql, $conn); while($row = mysql_fetch_array( $result )){ echo "<a href=showorders.php?search="; echo "".$row['lname']; echo "&searchl="; echo "".$row['fname']; echo ">"; echo "".$row['fname']; echo "".$row['lname']; echo "<br>"; echo "</a>"; } and here is the code at the script it's being sent to. $search = $_GET['search']; $searchl = $_GET['searchl']; $sql = "SELECT * FROM orders WHERE lname LIKE '%$search%'"; I want this SELECT to use both $search and $searchl to get the exact result. Thanks Conker, your code is much nicer. But I'm pretty happy with my working mess
  14. This actually works, but only for the last name, how would I add a first name into the URL (I commented that out)? $sql = "SELECT * FROM orders WHERE lname LIKE '$search'"; $result = mysql_query($sql, $conn); while($row = mysql_fetch_array( $result )){ echo "<a href=showorders.php?search="; //echo "".$row['fname']; //echo "searchl="; echo "".$row['lname']; echo ">"; echo "".$row['fname']; echo "".$row['lname']; echo "<br>"; echo "</a>"; }
  15. Ok I've thought of a way to get to choose between multiple search results (ones with the same last name). I haven't been using $_GET but I thought this would be the easiest way. This code doesn't work, but any tips on how I can make it happen? just guessing this stuff. //create a query $sql = "SELECT * FROM orders WHERE lname LIKE '$search'"; $result = mysql_query($sql, $conn); while($row = mysql_fetch_array( $result )){ echo "<a href=showorders.php?searchf=$row['fname']searchl=$row['lname']>"; echo "".$row['fname']; echo "".$row['lname']; echo "</a>"; }
  16. Cool that solves me having to type in the exact name. Just need to work out how I can return multiple results. Thanks.
  17. At the moment I have to type in the full (exact) last name of an order to access it. Say if an order was for russel and another for rusker, I'd like to be able to type rus and have both orders come up. I am trying to find out how to do this so I can then have multiple results displayed and I can click on the right one. (in the case 2 or more people share the same last name) as you can imagine this can cause serious problems :| Here is my search query, any information is appreciated. //creating query $sql = "SELECT * FROM orders WHERE lname LIKE '$search'"; $result = mysql_query($sql, $conn); $row = mysql_fetch_array( $result );
  18. Cool thanks I'll do that, never used divs before only tables :-\, so I'll go about learning that, looks cool.
  19. Because it's going to be a list of names and I want to be able to scroll through them on the left side of the screen, could get pretty long.
  20. I've got a php document that works fine but I've tried to put it in a frame so it can run next to the main order page, php doesn't seem to like frames and it just spits out all the code in the frame. How do I run php in a frame?
  21. yeah mate that's what I'm asking help for. I want to only change the status for the order that is shown in the $row variable.
  22. lol think I worked it out already changed status='1' to status'$row'
×
×
  • 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.