Hey guy's, I know this has to be simple but I can't figure out how to echo every $row['id'] incremented by +1 so that [0] is replaced by '1' and [1] is replaced by '2' etc.
I need it to setup javascript pagination onclick of spans. Eg.
In any case I'd like to know the words used to express what I''m trying to do as it isn't increment $row['id'] by 1 as that would call the next row instead of incrementing the echoed result by one? I'm guessing 'Increment the echoed result Id by 1 so that zero isn't the result. Thanks for any help. Maybe like javascript array.indexOf($row[i])???
Belrick, right on, I ended up doing it client side I just couldn't express the php language properly to get the web search with that answer. Muchos mas gracias para te. It's more like javascript than I thought. dangerousprince, MY MOTHER HAD SOME OF THEM
Belrick, hey that var $x doesn't work on every row? It sets every row id to 1. You hinted that sql php admin can have the first row set as 1 not 0? Autoincremet by 1 normaly starts with 0 and I'm pritty sure I tried starting the row id's with 1 and ended up getting sql errors but of course I could be 'micing' if not 'rating'. Please steer me in the right direction.
FYI; MYSQL provides for you the ability to set the number auto increments begins at. Just saying.
are you talking about the query string in the Get .php page or myphpadmin? I just changed the shortest table, 2 rows with 'id as primary key' row 0 to row 1 and row 1 to row 2. Row 0 still gets echoed as blank and rows 1 and 2 are eched fine so I'm guessing you are talking about the query string. Without the $x var working in the server then client side increment would be the only way to go to avoid blank rows in all tables?
Bookmarks