crombiecrunch Posted May 10, 2008 Share Posted May 10, 2008 Ok I am not good with this stuff at all. What I am trying to do is create a website http://devilsplayground.in. Which has a class recruitment section on the main page. I am running in to a problem with classes that have more then one word, for example Bear Shaman. My field is setting, type varchar(50) and for the value I have tried Bear Shaman, and Bear Shaman. Both of those ways display the text fine on the site. When I go to my admin section to set the status for that class (closed,high,medium,low) it will not save the new status to it. As you can see on my main page there is no status listed for Bear Shaman. But If i go to my database and make the value BearShaman with no space it updates just fine. How do I get the space added and able to update the field? Quote Link to comment Share on other sites More sharing options...
mezise Posted May 10, 2008 Share Posted May 10, 2008 Hi, looks like problem with PHP code, not MySQL. Quote Link to comment Share on other sites More sharing options...
AndyB Posted May 10, 2008 Share Posted May 10, 2008 Or, it's a problem with the html form input not having quotes around attributes. Quote Link to comment Share on other sites More sharing options...
crombiecrunch Posted May 10, 2008 Author Share Posted May 10, 2008 thanks for the reply. Here is the code used on the page to update it any ideas? <fieldset> <legend>Recruitment settings</legend> <dl> <dt><label>Recruitment Status :</label></dt> <dd> <select name="status" class="input" id="status"> <!-- BEGIN status_row --> <option value="{status_row.VALUE}"{status_row.SELECTED}>{status_row.OPTION}</option> <!-- END status_row --> </select> <dd> </dl> <!-- BEGIN recruitment --> <dl> <dt><label> {recruitment.CLASS} :</label></dt> <dd> <select name="{recruitment.CLASS}" class="input" id="{recruitment.CLASS}"> <!-- BEGIN status_row --> <option value="{recruitment.status_row.VALUE}"{recruitment.status_row.SELECTED}>{recruitment.status_row.OPTION}</option> <!-- END status_row --> </select> <dd> </dl> <!-- END recruitment --> </fieldset> <p class="quick"> <input type="submit" name="update" value="{L_SUBMIT}" class="button1" /> <input type="reset" name="reset" value="{L_RESET}" class="button1" /> </p> </form> <!-- INCLUDE overall_footer.html --> Quote Link to comment Share on other sites More sharing options...
mezise Posted May 10, 2008 Share Posted May 10, 2008 The template looks OK. Maybe post generated html code of this template (with "Bear Shaman" value). Quote Link to comment Share on other sites More sharing options...
fenway Posted May 11, 2008 Share Posted May 11, 2008 Since there's no sql anywhere to be seen, this topic is in danger of being moved to another forum. Quote Link to comment Share on other sites More sharing options...
crombiecrunch Posted May 11, 2008 Author Share Posted May 11, 2008 sorry you can move it if needed. originally i thought it was a sql question. Quote Link to comment Share on other sites More sharing options...
AndyB Posted May 11, 2008 Share Posted May 11, 2008 sorry you can move it if needed. originally i thought it was a sql question. It might well be. As we haven't seen any code for adding (or failing to add) information to the database it's hard to be sure. Maybe you need to post some of the non-working code and then we'll know if this post needs to be moved and where. Quote Link to comment Share on other sites More sharing options...
crombiecrunch Posted May 11, 2008 Author Share Posted May 11, 2008 Sorry it took me a while to find the html file. LOL like I said I am a blind man in dark room here with all of this. the html code looks like this: <!-- BEGIN recruitment --> <dl> <dt><label> {recruitment.CLASS} :</label></dt> <dd> <select name="{recruitment.CLASS}" class="input" id="{recruitment.CLASS}"> <!-- BEGIN status_row --> <option value="{recruitment.status_row.VALUE}"{recruitment.status_row.SELECTED}>{recruitment.status_row.OPTION}</option> <!-- END status_row --> </select> <dd> </dl> <!-- END recruitment --> </fieldset> <p class="quick"> <input type="submit" name="update" value="{L_SUBMIT}" class="button1" /> <input type="reset" name="reset" value="{L_RESET}" class="button1" /> </p> </form> which to me looks just the same as the .php file with the same name. So I am at a loss still lol Quote Link to comment Share on other sites More sharing options...
mezise Posted May 11, 2008 Share Posted May 11, 2008 Generated html code of the template is part of a source code of html page where you see your list When I go to my admin section to set the status... Then mouse left-click, choose "View Source", find part within <fieldset></fieldset> tags <fieldset> <legend>Recruitment settings</legend> ... </fieldset> and post it. Quote Link to comment Share on other sites More sharing options...
crombiecrunch Posted May 11, 2008 Author Share Posted May 11, 2008 <fieldset> <legend>Recruitment settings</legend> <dl> <dt><label>Recruitment Status :</label></dt> <dd> <select name="status" class="input" id="status"> <option value="Open" selected="selected">Open</option> <option value="Closed">Closed</option> </select> <dd> </dl> <dl> <dt><label> Bear Shaman :</label></dt> <dd> <select name="Bear Shaman" class="input" id="Bear Shaman"> <option value="Closed">Closed</option> <option value="High">High</option> <option value="Medium">Medium</option> <option value="Low">Low</option> </select> <dd> </fieldset> <p class="quick"> <input type="submit" name="update" value="Submit" class="button1" /> <input type="reset" name="reset" value="Reset" class="button1" /> </p> </form> removed the other classes from the code. Quote Link to comment Share on other sites More sharing options...
mezise Posted May 11, 2008 Share Posted May 11, 2008 The problem is with name="Bear Shaman" Value of name attribute should contains alphanumeric or underscore characters. Maybe administration page contains 2 form fields for status, one for name attribute and one for displayed status name? Well designed application should allow spaces in names and appropriate handle name attribute values. Try underscore character instead of space. Maybe application replaces underscores to spaces when status is displayed. If nothing above mentioned will work we may try to debug your application. Quote Link to comment Share on other sites More sharing options...
fenway Posted May 12, 2008 Share Posted May 12, 2008 Agreed... but it's easier to replace with a whitespace on output. 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.