Ryoku Posted August 15, 2008 Share Posted August 15, 2008 I don’t know enough about arrays to use this correctly so I think I should ask someone. I have a problem with a news system I’m making, I have an array that the sql response give me and when I call them it gives me the data in the order the DB vomits. Well my problem is that I want to create an edit button for a/the post but I need to do so based off the date, the root of the problem is that if I call the date again I will get the next date in the array not the date of the post I want to edit. Essentially what I’m asking is how do I call the same data twice in the same loop? Quote Link to comment Share on other sites More sharing options...
trq Posted August 15, 2008 Share Posted August 15, 2008 Were going to need to see an example of exactly what it is you want to do. Quote Link to comment Share on other sites More sharing options...
Ryoku Posted August 15, 2008 Author Share Posted August 15, 2008 wow, completely not how i thought it was going to react. i didn't even test it because i thought it was going to error. ... um it worked correctly when i called the value twice in the same loop but for the sake of argument and example this is the snippet in question ^^; $result = mysql_query("SELECT * FROM post ORDER BY date DESC LIMIT 5 OFFSET " . $offset); while($row = mysql_fetch_array($result)) { echo $row[date] . "<br> \n"; echo $row[subject] . "<br> \n"; echo $row[body] . "<br>\n"; echo "<hr>\n"; echo $row[date]; } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.