Jump to content

Need help with adding to the database


crombiecrunch

Recommended Posts

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?

Link to comment
Share on other sites

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 -->

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

<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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.