HTML and PHP issue: mysqli_error() expects exactly 1 parameter, 0 given

Knodaeldere

New Member
I'm trying to create a form in an HTML page that sends the data to a database, the form worked with three variables but now I've changed it to 5 and it doesn't work, some help would be much appreciated.\[code\]<?php$con=mysqli_connect("","root","","alex");if (mysqli_connect_errno()){echo "Failed to connect to MySQL: " . mysqli_connect_error();}$sql="INSERT INTO order (orderNo, firstName, lastName, address, postcode) VALUES ('$_POST[orderno]','$_POST[firstname]','$_POST[lastname]','$_POST[address]','$_POST[postcode]')";if (!mysqli_query($con,$sql)){die('Error: ' . mysqli_error());}echo "Order Placed";mysqli_close($con);?><p>\[/code\]and the form I am using is:\[code\]<form action="order.php" method="post"><p><input type="hidden" name="orderno"><p>Firstname: <input type="text" name="firstname"><p>Lastname: <input type="text" name="lastname"><p>First Line of Address: <input type="text" name="address"><p>Post Code: <input type="text" name="postcode"><p><input type="submit"></form>\[/code\]I can't see what is going wrong.Thank you in advance.
 
Top