I have a laravel collection below from: $unitinventory = DB::select(‘call wh_inventory_list(?)’, array(‘Units’)); And another collection: $modifification = collect(DB::table(‘pd_jo_bodymodification’)->get()); I want to find out if a $unitinventory->chassis_no has a mo…
Tag: php
Add Term Meta from Custom Taxonomy to Cart Item
What I’m trying to accomplish is adding term meta from a custom taxonomy that is attached to a product and display it on the cart/checkout/ order details/email notification. I’m not the greatest at this but know enough to get by. What I’m using is the ‘Perfect Brands WooCommerce’…
required attribute not working in form in codeigniter php
i have a shopping website in codeigniter, where have a product details page, in which user should select the color and size which is mandotory before adding to cart, so i did the following code: however, the required attriubute is not working, user is able to click the add to cart button, can anyone please te…
How to prevent PHP SESSION closing when the page is refreshed?
I have created Signup and Login systems for my gallery website. When a user tries to login into system, their user and password and admin privilege is checked. If it was successful, the username is appeared on top left corner of the home page and Login turns to Logout. The problem is that when I refresh the p…
Passing values to blade using redirect() and back() functions
I have successfully pass values from form to controller. Calculation is is working well, since its dump all the values using dd($fee); dd($vat); dd($Transaction_vat);. But now, when I try to pass the values to blade using return redirect()->back()->with(‘fee’, $fee ,’vat’, $vat ,…
odbc_exec(): SQL error: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1., SQL state 07001 in SQLExecDirect
I have some problem in PHP using MS Access database, when I running the query in PHP show error odbc_exec(): SQL error: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1., SQL state 07001 in SQLExecDirect But when I’m going echo the “$query” variable and running the sy…
PHP display name of login user
I am trying to display the name of a user when they are logged in. My code uses $_SESSIONS to store the name, but since there no input in my login in page, the name doesn’t get assign and it ends up being just hello, instead of something like hello, John Smith. I’ve tried using sql to select the n…
Factory creating multiple models with different number of relationships
I’m using the following code to create 20 posts, each of which has 3 comments. Instead I’d like to create 20 posts, each of which has a random number of comments (e.g. post 1 has 2 comments, post 2 has 4 comments, etc.) This did not work, each post had the same (random) number of comments. How can…
How to add payment fee to cart in Prestashop?
I want to add payment fee to cart with a product created for payment fees. But when i add to cart the product for fee then i use $cart->getOrderTotal(), it doesn’t show the real price with fee. It shows the order total as product price without fee. I use SpecificPrice class for this action. And i thi…
Speed of inserting to BigQuery – should this be batched in background?
I have simple URL shortener (PHP) where I’m tracking clicks. Every click is saved to database (mysql currently) as separate row because I need also info about device, country etc. It works great but when table grows and grows queries becomes slow, so I want to migrate to BigQuery (I know they are differ…