I have 2 questions:

1. I have a product add form which adds data to 2 tables when submitted. If for some reason the connection fails after executing the first insert I want to disregard the entire submission. How do I tell mysql(php?) to either execute both inserts or none?

2. I also have a edit page which loads a similar form as product add form but with the current values already displayed in the proper input fields. I have a field (varchar(25)) in my database that stores more than one word. However when I retreive that information in the text field only the first word of the cell data shows up. On querying the database through command prompt shows the entire cell data. How can make the text field to show the entire cell data.
Below is the code of the edit part of the page.

PHP Code:
if ($edit
{
$category =mysql_query("SELECT id, name, parent_id " .
                 
"FROM categories " 
                     
"WHERE ID=$edit");
 if (!
$category) { 
    echo(
"<P>Error querying database</P>");
 } else { 
   
$category=mysql_fetch_array($category);
   
$name=$category["name"];
   
$id=$category["id"];
   echo(
"<form action='$php_self' method=post >
echo("
Name: <input type=text name=category maxlength=100 value=$name>
<
input type=hidden name=id value=$edit>
<
p><input type=submit name=update value=Update>
<
input type=reset value=Reset> </form>");
 } 

I am done for today. Hope to get some reply by Monday.

Thanks for the help in advance.