mysqli_error() needs you to pass the connection to the database as a parameter. Documentation here has some helpful examples:
http://php.net/manual/en/mysqli.error.php
Try altering your problem line like so and you should be in good shape:
$query = mysqli_query($myConnection, $sqlCommand) or die (mysqli_error($myConnection));
More Related Contents:
- Object of class mysqli_result could not be converted to string
- mysqli_query() expects at least 2 parameters, 1 given
- mysqli_stmt::bind_result(): Number of bind variables doesn’t match number of fields in prepared statement
- SELECT COUNT(*) AS count – How to use this count
- Mysqli update throwing Call to a member function bind_param() error [duplicate]
- mysqli bind_param() expected to be a reference, value given
- Should I manually check for errors when calling “mysqli_stmt_prepare”?
- mysqli_real_escape_string() expects exactly 2 parameters, 1 given
- INSERT – Number of bind variables doesn’t match number of fields in prepared statement
- Call to a member function execute() on boolean in [duplicate]
- Mysql No connection could be made because the target machine actively refused it
- How to connect to MySQL database in PHP using mysqli extension?
- How do I count query result rows?
- Bind Param with array of parameters
- How do you use IN clauses with mysqli prepared statements [duplicate]
- What to do with mysqli problems? Errors like mysqli_fetch_array(): Argument #1 must be of type mysqli_result and such
- Fatal error: Uncaught exception ‘mysqli_sql_exception’ with message ‘No index used in query/prepared statement’
- How to fetch all in assoc array from a prepared statement?
- Fatal error: Call to undefined function mysqli_result()
- Fatal error: Call to undefined method mysqli_stmt::fetch_array() [duplicate]
- Why I am getting an error when using w3school tutorial? [duplicate]
- Using wildcards in prepared statement
- mysqli_connect(): (HY000/2002): No connection could be made because the target machine actively refused it
- How to remove the fatal error when fetching an assoc array
- Fatal error: Call to undefined method mysqli_stmt::get_result()
- PHP MySQLi Multiple Inserts
- Fatal error: Call to a member function prepare() on a non-object in
- Set character set using MySQLi
- Cannot figure out how to run a mysqli_multi_query and use the results from the last query
- How to get a list of databases?