sashavalentina Posted December 9, 2021 Share Posted December 9, 2021 I want to submit my data to the notifications table, I am not sure why do i got this type error. Can anyone lend me a helping hand and help me with this problem? $product_name = $row['cart_name']; $cn_product_name = $row['cn_cart_name']; $m_product_name = $row['m_cart_name']; $variable00 = 'New'; $variable01 = '新订单'; $variable02 = 'Pesanan Baharu'; $variable03 = '<b>Order No: #'; $variable04 = '</b><br>'; $variable05 = 'for'; $variable06 = 'is Placed Successfully'; $variable07 = '<b>订单号: #'; $variable08 = '</b><br>已成功下单'; $variable09 = ' 的'; $variable10 = '<b>Nombor Pesanan: #'; $variable11 = '</b><br>Pesanan untuk'; $variable12 = 'anda sudah berjaya'; $variable13 = 0; $nQuery = "INSERT INTO notifications (notification_title, cn_notification_title, m_notification _title, notification_date, notification_text, cn_notification_text, m_notification_text, user_id, seller_id, order_id, product_id, user_notify, seller_notify, admin_notify) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; $stmt= $conn->prepare($nQuery); $stmt->bind_param("sssssssiiiiiii",$variable00.$order_type, $variable01, $variable02, $now, $variable03.$order_id.$variable04.$order_type.$variable05.$quantity.$quantity_unit.$product_name.$variable06, $variable07.$order_id.$variable07.$quantity.$quantity_unit.$variable09.$cn_product_name, $variable10.$order_id.$variable11.$quantity.$quantity_unit.$m_product_name.$variable12, $user_id, $seller_id, $order_id, $product_id, $variable06, $variable06, $variable06); $stmt->execute(); Quote Link to comment https://forums.phpfreaks.com/topic/314288-how-to-solve-uncaught-error-call-to-a-member-function-bind_param-on-bool/ Share on other sites More sharing options...
requinix Posted December 9, 2021 Share Posted December 9, 2021 There's a syntax error in your query. Take a look to see if you can spot it, otherwise use mysqli::$error to see what the error message can tell you. Quote Link to comment https://forums.phpfreaks.com/topic/314288-how-to-solve-uncaught-error-call-to-a-member-function-bind_param-on-bool/#findComment-1592559 Share on other sites More sharing options...
mac_gyver Posted December 9, 2021 Share Posted December 9, 2021 3 hours ago, sashavalentina said: submit my data to the notifications table only the raw data values belong in the database table. the presentation markup is not part of the data and would be applied if/when you output the data in a html context. Quote Link to comment https://forums.phpfreaks.com/topic/314288-how-to-solve-uncaught-error-call-to-a-member-function-bind_param-on-bool/#findComment-1592562 Share on other sites More sharing options...
ginerjm Posted December 9, 2021 Share Posted December 9, 2021 As Mac_gyver has said, "where is the data"? One doesn't (usually) store html code or 'literals' in a table - that is the place for pure data. What you are storing here is boilerplate - the labels, names, punctuation and presentation material, not 'information' that can't be stored elsewhere. Such a waster of time to make up a query to store this stuff when a couple of lines of html and it's done! Plus what's with the long concatenated value you are creating after the "now" variable? That alone is so against the RDBMS book that it is laughable. You need to re-think your approach (or understanding?) to data storage and database design and usage. It will be good reading and much improve your use of this technology. Enjoy the learning process. Quote Link to comment https://forums.phpfreaks.com/topic/314288-how-to-solve-uncaught-error-call-to-a-member-function-bind_param-on-bool/#findComment-1592564 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.