penguin0 Posted May 26, 2007 Share Posted May 26, 2007 Is there a way to show all fields in a table after a certain field, lets call it "position". If so please provide the code. Quote Link to comment https://forums.phpfreaks.com/topic/53107-show-all-fields-after-a-certain-field-in-mysql/ Share on other sites More sharing options...
AndyB Posted May 27, 2007 Share Posted May 27, 2007 What are you trying to achieve? Do you want to know the fields, or the data in them? Quote Link to comment https://forums.phpfreaks.com/topic/53107-show-all-fields-after-a-certain-field-in-mysql/#findComment-262343 Share on other sites More sharing options...
penguin0 Posted May 27, 2007 Author Share Posted May 27, 2007 EDIT:I need to print the fields so I can use them in an edit script. Quote Link to comment https://forums.phpfreaks.com/topic/53107-show-all-fields-after-a-certain-field-in-mysql/#findComment-262350 Share on other sites More sharing options...
penguin0 Posted May 27, 2007 Author Share Posted May 27, 2007 I guess I would need a loop to print the field name into this so i can directly pull from the db instead of making a new one for each: <label> <input type="radio" name="rateman" value="1" ' . ($urateman == 1 ? 'checked="checked"' : '') . ' /> Yes <input type="radio" name="rateman" value="0" ' . ($urateman == 0 ? 'checked="checked"' : '') . ' /> No </label> Quote Link to comment https://forums.phpfreaks.com/topic/53107-show-all-fields-after-a-certain-field-in-mysql/#findComment-262364 Share on other sites More sharing options...
penguin0 Posted May 27, 2007 Author Share Posted May 27, 2007 can someone at least tell me how to print the fields after a certain field? Quote Link to comment https://forums.phpfreaks.com/topic/53107-show-all-fields-after-a-certain-field-in-mysql/#findComment-262896 Share on other sites More sharing options...
gabeg Posted May 27, 2007 Share Posted May 27, 2007 have you tried using LIMIT? ie if your position is 4..LIMIT 5,100 Quote Link to comment https://forums.phpfreaks.com/topic/53107-show-all-fields-after-a-certain-field-in-mysql/#findComment-262898 Share on other sites More sharing options...
AndyB Posted May 27, 2007 Share Posted May 27, 2007 have you tried using LIMIT? ie if your position is 4..LIMIT 5,100 That's how you restrict how many records are processed, not how many fields (out of an unknown number). Quote Link to comment https://forums.phpfreaks.com/topic/53107-show-all-fields-after-a-certain-field-in-mysql/#findComment-262921 Share on other sites More sharing options...
penguin0 Posted May 29, 2007 Author Share Posted May 29, 2007 I guess this is not possible then? Quote Link to comment https://forums.phpfreaks.com/topic/53107-show-all-fields-after-a-certain-field-in-mysql/#findComment-263572 Share on other sites More sharing options...
AndyB Posted May 29, 2007 Share Posted May 29, 2007 It's a bit weird, but you could workaround your problem by using the list-fields query, and creating an array of the database fields (in the order that they exist) then selecting all (*) fields and only outputting data for fields after the one you designate. http://aspn.activestate.com/ASPN/docs/PHP/function.mysql-list-fields.html I'll leave it to you to figure that one out Quote Link to comment https://forums.phpfreaks.com/topic/53107-show-all-fields-after-a-certain-field-in-mysql/#findComment-263578 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.