I feel like this should be easy but it isn't working. $result = mysql_query("select photo from photo where user_id = '".$user_id."' and photo = '".$photo."' "); $link = mysql_result($result, 1); i get an unable to jump row error. i know this query works with mysql result($result, 0); but it wont work with a row jump of 1. anyone know why? thanks for any help
oh, lol. my bad. that makes all kinds of sense. uhh then what i was trying to do is select all the photos of a user order it by time desc and then select the photo one jump down from the current photo. is there a way i can select the starting point for a mysql jump. thanks for putting up with my ridiculousness.
i would like to to jump one photo up from the current photo name defined by $photo($photo is a 13 character id followed by a .jpg or .png or whatever) in a list of of the users photos ordered by a timestamp. thanks man
sorry sef no luck. though i think i might have misunderstood. what i tried was $result = mysql_query("select photo from photo where user_id = '".$user_id."' and photo = '".$photo."' limit 1, 1 "); $link = mysql_result($result, 1); print "$link"; same error, but there is also an error if u try mysql_result with a jump of 0. perhaps i could select * of the photos of a user put them into an array then select the one above of below the current phot? is there a way to select from arrays like that? thanks wrighty
Remove the Photo = "...." stuff Then you can step through like you tried to in your original post. Oh and remove the Limit too!
Try this $result = mysql_query("select photo from photo where `user_id` = '$user_id' and `photo` = '$photo' "); PHP:
So i have tried your methods and being a bumbling asstard i had no luck. so i though about this, and what i think i want to know is can i select the number of an array row by it's value. example in an array array( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 ) A A | |___________________ |________ | | | can i return this value by selecting this sorry if my explination is bad =( anyway what all of this code is for is to select the id of the next photo when ordered by time desc. So that i can create a url with the id of the next and previous photo so that the user can browse photos.