Jump to content

[SOLVED] small error


jacko_162

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

Archived

This topic is now archived and is closed to further replies.

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