Adding to mysql
Posted: Sat Jun 28, 2003 2:48 pm
What is actually wrong here? I've double checkes everything but it still doesn't add anything to the database.
This is the error I get:
Code: Select all
$link = mysql_connect( $hostname, $username, $password );
mysql_select_db( $db )
or die ( "Couldn't open $db: ".mysql_error() );
//The query adding the data to the database
$query = "INSERT INTO products ( prodnr, category, product, price, info, short_info, weight, image )
VALUES( '".$_POSTї'prodnr']."', '".$_POSTї'category']."', '".$_POSTї'product'].$_POSTї'price'].$_POSTї'info']."', '".$_POSTї'short_info']."', '".$_POSTї'weight']."', '".$_POSTї'image']."' )";
mysql_query( $query, $link )
or die (" Couldn't add data to "products" table: "
.mysql_error() );
mysql_close( $link );Code: Select all
Couldn't add data to "products" table: Column count doesn't match value count at row 1