मैं इस त्रुटि हो रही है:पीएचपी, MySQL त्रुटि: कॉलम की संख्या पंक्ति में मूल्य संख्या मेल नहीं खाती 1
$name = $_GET['name'];
$description = $_GET['description'];
$shortDescription = $_GET['shortDescription'];
$ingredients = $_GET['ingredients'];
$method = $_GET['method'];
//$image = $_GET['image'];
$username = $_GET['username'];
$length = $_GET['length'];
$dateAdded = uk_date();
$conn = mysql_connect('localhost', 'dbname', 'pass');
mysql_select_db('dbname');
$query = sprintf("INSERT INTO dbname (id, Name, Description, shortDescription, Ingredients, Method, Length, dateAdded, Username) VALUES ('', '%s', '%s', '%s', '%s', '%s', '%s', '%s')",
mysql_real_escape_string($name),
mysql_real_escape_string($description),
mysql_real_escape_string($shortDescription),
mysql_real_escape_string($ingredients),
//mysql_real_escape_string($image),
mysql_real_escape_string($length),
mysql_real_escape_string($dateAdded),
mysql_real_escape_string($username));
$result = mysql_query($query) or die(mysql_error());
क्या करता है:
Column count doesn't match value count at row 1
निम्न कोड से त्रुटि मतलब है?
आपने टिप्पणी की है कि // // mysql_real_escape_string ($ image), 'आपकी क्वेरी आपके द्वारा पास किए गए 9 चरों की प्रतीक्षा करती है 8 – afarazit
मैं छवि को एक और तरीके से अपलोड करने जा रहा हूं। छवि कुंजी तालिका में है, लेकिन इसके लिए एक मूल्य डाला नहीं जा रहा है। क्या यह एक कारण हो सकता है? –