Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old September 5th, 2008, 10:49 AM
Newbie
 
Join Date: Sep 2008
Location: Harare
Age: 21
Posts: 7
Default am being unable to insert staff in my sql database using wamp server

k
am using php and mysql in dreamweaver.the thing is my code seems k and when running my webpage it is saying my staff are successfully inserted in mysql db.mysql database table has 4 columns ,productdescription,product quantity ,servicespecifications and requesyt id wc is auto increment.the auto increment is based on all the other columns being inserted .the problem is when when the staff is being dimmed as insertd in the database the request id auto increments its self,and nomatter wat qnty u enter it is displayed as 0.
here is my code:
<?php include('mysqlcon.php');

$ProdSpec= $_POST['ProdSpec'];
$ProdQnty= $_POST['ProdQnty'];
$ServDes = $_POST['ServDes'];
//select database
mysql_select_db($database_workplan_db, $workplan_db);
// create query
$query = "INSERT INTO request(ProdSpec,ProdQnty,ServDes)VALUES('$ProdSpe c','$ProdQnty', '$ServDes')";

$result = mysql_query($query,$workplan_db) or die ("Error in query: $query. ".mysql_error());
if($result) {
echo "request values successfully inserted, thank you.";
exit();
} else {
echo"cannot inserted request values";
}

?>
Reply
  #2  
Old September 5th, 2008, 10:59 AM
Administrator
 
Join Date: Sep 2006
Posts: 11,312
Default

Where is the id being displayed as 0?
Reply
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles