The update to the demo store files for MySqli is much appreciated! It saves me time. However there are still many errors inside the demo store files inside of "Admin" folder. Some I was able to correct to make code functional such as switching mysql to mysqli where needed to get pages to show correctly. The connections file for includes had a few errors For Your Information.
I was using admin store to add products in products details but received errors. Examples of demo store current errors where I'm a little stuck and could use help include:
ProductDetailsAdd.php not able to add products due to error " Warning: mysqli_query() expects parameter 1 to be mysqli, string given in C:\wamp\www\Shopping\Admin\Product\ProductDetailsAdd.php on line 412" and "Warning: mysqli_error() expects exactly 1 parameter, 0 given in C:\wamp\www\Shopping\Admin\Product\ProductDetailsAdd.php on line 412
I noticed that when you're using mysqli the syntax for it looks as though you're using mysql syntax format vs newer mysqli_query ( $connection, $string ) . I'm seeing the placement of parameters in arguments such as " Mysqli_query ($string, $connection) " I believe that $connection as first parament, then 2nd $string). I don't know if this is allowed by MySqli or not for sure and no value (parameter) for MySqli_Error commands which it appears that MySqli requires a value generating an error.
I'm not an advanced coder and have very little understanding of "PHP" as a whole. Here's the code below that's causing issues with adding products in productdetails when clicking add new button.
<?php $list = preg_split("/,/", $row_rsProduct['OptionList']); $hasOptions = false; for($i=0; $i<count($list); $i++){ if($totalRows_rsOptionProduct != 0){ $query_rsOptionProductDetail = "SELECT OptionProductDetail.IdOptionProductDetail, OptionProductDetail.IdOptionProduct, OptionProductDetail.Description, OptionProductDetail.Visible, OptionProductDetail.SortOrder, OptionProduct.OptionDescription FROM OptionProduct INNER JOIN OptionProductDetail ON OptionProduct.IdOptionProduct = OptionProductDetail.IdOptionProduct where OptionProductDetail.IdOptionProduct = " .$list[$i]; "This line is causing errors"********----> $rsOptionProductDetail = mysqli_query($query_rsOptionProductDetail,$shop) or die(mysqli_error()); <-----******This line causing errors Error Type " $row_rsOptionProductDetail = mysqli_fetch_assoc($rsOptionProductDetail); $count = mysqli_num_rows($rsOptionProductDetail);
$query_rsOptionProduct = "SELECT * FROM optionproduct where IdOptionProduct = " .$list[$i] ." ORDER BY SortOrder ASC"; $rsOptionProduct = mysqli_query($query_rsOptionProduct, $shop) or die(mysqli_error()); $row_rsOptionProduct = mysqli_fetch_assoc($rsOptionProduct); //OptionProduct.filter = "[IdOptionProduct] = " & list(J) //OptionProductDetail.filter = "[IdOptionProduct] = " & list(J) if($count > 0){ $hasOptions = true; ?>
Jay Hill |
|
|