Welcome Guest, Not a member yet? Register   Sign In
how to update multiple records in model
#1

(This post was last modified: 06-27-2018, 09:00 PM by kvanaraj.)

my query should be 



$query="update <table_name> set $ass=$assmark where regno=$regno and markid=$markid" ;
it;s working in controller file. but it gives error.


You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'where regno= and markid=50009' at line 1

update pre_marks set Att1= where regno= and markid=50009

******************************

my output should be
****************
$markid=50009;
$ass='Ass1';

Array
(
   [regno] => 218417103001
   [Att1] => 58
)


Array
(
   [regno] => 210417103002
   [Att1] => 23
)


Array
(
   [regno] => 2145417103003
   [Att1] => 20
)


Array
(
   [regno] => 2104517103004
   [Att1] => 45
)


Array
(
   [regno] => 21941787103005
   [Att1] => 25
)

Array
(
   [regno] => 21941745103006
   [Att1] => 0
)
Reply




Theme © iAndrew 2016 - Forum software by © MyBB