0
<?php mysql_connect("localhost","root","root") or die (mysql_error);
		mysql_select_db("test") or die (mysql_error);
		
		$ProductName = $_POST['ProductName'];
		$Price = $_POST['Price'];
		$Quantity = $_POST['Quantity'];
		$Description = $_POST['Description'];
		
		 $query = "insert into ProductTable(ProductName,Price,Quantity,Description) value
		 	('$ProductName','$Prioce','$Quantity','$Description')";
			
			
			mysql_query($query) or die ($query);
			
			?>

i already review it,i have the database and is also connected and yet the browser is just displaying the query line...can u help me about this?

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by diafol
0

Well, you could try this to catch the error instead of letting it be silent:

<?php mysql_connect("localhost","root","root") or die (mysql_error);
		mysql_select_db("test") or die (mysql_error);
		
		$ProductName = $_POST['ProductName'];
		$Price = $_POST['Price'];
		$Quantity = $_POST['Quantity'];
		$Description = $_POST['Description'];
		
		 $query = "insert into ProductTable(ProductName,Price,Quantity,Description) value
		 	('$ProductName','$Prioce','$Quantity','$Description')";
			
			
mysql_query($query) or die('\"'.$query.'\" Query failed: ' . mysql_error());
			
			?>
0

$Prioce isn't $Price - but I doubt that would cause an sql failure.

Shouldn't 'value' be 'values'?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.