On Thu, May 21, 2009 at 7:32 AM, Vernon St.Croix <[email protected]>wrote:
> *Warning*: mysqli_query() expects parameter 1 to be mysqli, object given
> in *C:\wamp\www\draft\checkout.php* on line *26*
>
> ***for the script
>
> <?php
>
> include("mysql.class.php");
>
> include ("header.php");
>
>
>
> //include ("functions.php");
>
> $user = 1;
> $total = 178.93;
>
> include ("mysql_connect.php");
>
> //Turn off autocommit
>
> //mysql_autocommit($con, FALSE);
>
> //Add orders to the order table
>
> $sql = "INSERT INTO orders (user_id, total) VALUES ($user, $total)";
>
> $r = mysqli_query($con, $sql);*
The warning message is saying that it's expecting the first parameter you
passed in mysqli_query() to be a mysqli link identifier, i.e., that the
variable $con used in the line above be your connection to the database.
Somewhere before this function call, you need to set $con:
$con = *mysqli_connect* ($host, $username, $passwd, $dbname);
-- Lex