Jump to content

Base

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Base's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Right, i'm being such a tool! code is: SELECT * FROM tutorials WHERE tut_id >= 10;
  2. A good day to one and all here at PHP Freaks! I have a slight problem: I want to be able to select information from a MySQL database after a specific row. So let's say that i wanted to do: SELECT * FROM tutorials WHERE ID =>10 Would that work? I am a little confused how to do that! Hope i have made myself clear enough. Base
  3. Ok. so i am going to take a stab in the dark here. A complete stab in the dark, as i allways use sessions rather than cookies. But if i do every use cookies, i use: setcookie("COOKIENAME", "COOKIEVALUE", time() + 3600); (3600 = 1 hour) Rather than using: setcookie("User_Name", $User_Name, strtotime('+ 30 minutes'));[/code I dunno, it might help you.. if not then sorry! Base
  4. I swear i must be the most newbish person on here :'( If i give you my code, could you please do me the most massive favour and re-do my code? I know this is asking allot, and if you don't want too, then thats OK, and i understand. Here is my current reciving file: <?php $id = $_POST['***']; $djname = $_POST['djname']; $query = "UPDATE profiles SET ID = '$ID' WHERE djname = '$djname'"; //Execute the query. $result = mysql_query($query) or die(mysql_error()); echo "<center><strong>ID order modified.</strong></center>"; ?>
  5. I'm sorry, you did explain that quite well and i thankyou very much for that. But i understood none of that! :'( Sorry to be a pain, but can someone give me the full code? Really sorry to be such a nag! Base
  6. The page code that i sent you displays the following: DJ Name: ID in the database: What i need to be able to do is: Edit the ID in the database, so that when i display it, it comes up in the order that i want
  7. Hi there, this is my virgin post in PHP Freaks, and i do hope you'll treat me real nice Anyway! I have come across a problem with some coding work that i am doing. My problem is the following: Presenters in the radio station, are shown in order of ID. What i want to be able to do, is edit the order in which they are shown, by editing the ID. My problem, is that when i process the form the script has no way of telling what the field names are, as they are not pre defined, because i have put the code in a while loop, to get all of the DJ's names & id's out. My code is below: <? $query = "SELECT * FROM profiles ORDER BY ID DESC"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { ?> <form method="post" action="viewpage.php?page_id=15"> <table align="center"> <tr> <td align="right">DJ Name:</td> <td><input name="name_<?php echo $row['ID']; ?>" type="text" id="<?php echo $row['ID']; ?>" value="<?php echo $row['djname']; ?>" size="40" maxlength="250" /></td></tr> <tr> <td align="right">Order:</td> <td><input name="id" type="text" id="djname" value="<?php echo $row['ID']; ?>" size="40" maxlength="250" /></td></tr> <tr><td> </td><td><input type="submit" name="submit" value="Modify" /> <input type="submit" name="Submit" value="Delete" /><input type="hidden" name="id" value="<?php echo $row['djname']; ?>" /></td></tr> </table> </form> <br><br><br><br> <?php } ?> So as you can see, it displays the DJ's by ID decending. I need to be able to: Edit all of the ID's to correspond to the order that i set (so myseld as id 1, my co-presenter as id 2 and so on) So if i submit the form with the buttons that are allready there, then it will only recognise the change to that specific form, rather than all the forms that are displayed. And thats about it! I hope i have made myself clear, i have tried to explain it well, but seeing as i don't really understand it myself, i won't have done that well. Can i request that when people reply they don't say like "oh google this: " or somthing like that, because when i do google things like that i just get more and more confused! Argh! So if someone could be fantastic and maybe give me the code, then i would be willing to donate maybe $20 to PHP Freaks or somthing like that. But thanks very much for reading, and i hope you can awnser my question! Cheers! Base
×
×
  • 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.