简体   繁体   中英

I want to insert in database when I click a button in my View file using codeigniter 3.x

I want to insert in database when I click button to store a single data only save value =1

<?phpif(intval($fspd->quantity) <= 0){echo '<form><input type="text" id="demo" value="" readonly ><a href="javascript:;"  onclick="clickdata()" class="btn btn-secondary btn-lg">Request For Restock</a></form>';}else{if($fspd->stock_status==1){?>
  1. Maybe it will help you to seperate your code more into its pieces. LIKE PHP, HTML and Javascript But this is just an advice to write cleaner code

  2. To answer your question: Have you looked into tutorials / documentation like this: https://www.studentstutorial.com/codeigniter/insert-data-codeIgniter

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM