Jump to content

Recommended Posts

i hope this makes sense,

 

i am starting to create my own mini CMS system and i have run in to a strange problem.

 

i have a page where the user can add catagories, and a page to add a product where you can select which catagory it belongs to.

 

now when i add a product with a the following info;

=================

Product Name: Test

Catagory: Fish

Price: £2.50

=================

everything works fine, but if i add a product with;

=================

Product Name: Test

Catagory: Soft Corals

Price: £2.50

=================

it doesnt add "Soft coral" to the product, instead it just adds "Soft" it discounts the space and the word coral?!

 

is there something i have done wrong? I use a drop down menu for the catagory select method and it pulls the catagory list from the catagory table in the DB.

 

the catagory field type is "mediumtext"

 

I hope i can fix this issue as its driving me nuts..

Link to comment
https://forums.phpfreaks.com/topic/84943-solved-small-error/
Share on other sites

sure;

 

<td><select name="catagory">
                          <?  
// Query to pull information from the "catagory" Database  
$result = mysql_query("select * from $table13 order by id DESC");  
while ($row = mysql_fetch_object($result)){  
?>
                          <option value=<?php echo $row->name; ?>> <?php echo $row->name; ?> </option>
                          <?}?>
                      </select></td>

 

thats for just the dropdown, and i use this for the INSERT:

 

// Query for insert
$sql = "INSERT INTO $table1 (name, make, catagory, price, description, sold, colour) VALUES ('$name', '$make', '$catagory', '$price', '$description', '$sold', '$colour')";
$query = mysql_query($sql) or die("Cannot query the database.<br>" . mysql_error());

Link to comment
https://forums.phpfreaks.com/topic/84943-solved-small-error/#findComment-433126
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.