Re: Check out system for Shopping Cart

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 21, 2009 at 7:32 AM, Vernon St.Croix <vstcroix@xxxxxxxxxxx>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

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux