phppup Posted February 22, 2012 Share Posted February 22, 2012 I know that I can fairly easily pull my data from the database and view it in a browser. I can also 'polish' it with some HTML or put it into a table. Can I get an item from a given VARIABLE to appear inside of an INPUT box, so that it looks the same as when it was initially submitted? Can it be done with a multiple choice SELECT dropdown, so that the item chosen is viewable again? Quote Link to comment https://forums.phpfreaks.com/topic/257542-viewing-data-from-query/ Share on other sites More sharing options...
scootstah Posted February 22, 2012 Share Posted February 22, 2012 Yes. $value = 'blah'; echo '<input type="text" name="something" value="' . $value . '" />'; Quote Link to comment https://forums.phpfreaks.com/topic/257542-viewing-data-from-query/#findComment-1320047 Share on other sites More sharing options...
phppup Posted February 22, 2012 Author Share Posted February 22, 2012 I was gonna try something like that, but i GREATLY appreciate your response. As a newbie it's VERY reassuring to know that something should work BEFORE attempting it. Now if I run into trouble, I can at least feel confident that the effort is worthwhile, rather than the concept being impossible. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/257542-viewing-data-from-query/#findComment-1320071 Share on other sites More sharing options...
scootstah Posted February 22, 2012 Share Posted February 22, 2012 As a newbie it's VERY reassuring to know that something should work BEFORE attempting it Indeed, but as a newbie it is also imperative that you test things out yourself and learn how they work. Quote Link to comment https://forums.phpfreaks.com/topic/257542-viewing-data-from-query/#findComment-1320073 Share on other sites More sharing options...
phppup Posted February 22, 2012 Author Share Posted February 22, 2012 Ohhhhhhh, rest assured, I AM!!!!! Just noticed that certain numeric inputs in the database are shown as 3.00 and others as 3. Then I realized some fields were SMALLINT and others were VARCHAR. I try not to post unless I'm really stumped, or short of time (because of the HOURS LOST chasing wrong solutions... LOL. Nonetheless, I am enjoying the process. Even at 3AM! Quote Link to comment https://forums.phpfreaks.com/topic/257542-viewing-data-from-query/#findComment-1320075 Share on other sites More sharing options...
scootstah Posted February 22, 2012 Share Posted February 22, 2012 If you are storing floats then you should use one of the float data types (float, double, real). Quote Link to comment https://forums.phpfreaks.com/topic/257542-viewing-data-from-query/#findComment-1320079 Share on other sites More sharing options...
phppup Posted February 22, 2012 Author Share Posted February 22, 2012 Just storing simple numbers, nothing >20 and only some are in intervals of .5 (ie: for certain items 1.0, 1.5, 2.0, 2.5 etc., and others just whole numbers: 1,2,3,4,5,etc) Quote Link to comment https://forums.phpfreaks.com/topic/257542-viewing-data-from-query/#findComment-1320089 Share on other sites More sharing options...
Pikachu2000 Posted February 22, 2012 Share Posted February 22, 2012 Then you wouldn't use integer data type. Here are the numeric data types for MySQL. Quote Link to comment https://forums.phpfreaks.com/topic/257542-viewing-data-from-query/#findComment-1320115 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.