Fanta Posted July 31, 2009 Share Posted July 31, 2009 mysqli version 5 $link =mysqli_connect('localhost','root','','asadb'); $sql ="insert into tbproduct (prod_id, prod_name, prod_desc, prod_rate, prod_img, prod_prc, prod_qty, prod_stat, prod_cratedt, prod_moddt) values ('$prodid', '$prodname', '$proddesc', '$prodrate', '$prodimg', '$prodprc', '$prodqty', '$prodstat', (now()), (now()))"; $mysqli->query($link,$sql); Doesn't insert data in table and no error is returned Link to comment https://forums.phpfreaks.com/topic/168300-mysql-inser-into/ Share on other sites More sharing options...
kickstart Posted July 31, 2009 Share Posted July 31, 2009 Hi Think you are mixing up mysqli object orientation and procedural call syntax. Try this $link = new mysqli('localhost','root','','asadb'); $sql ="insert into tbproduct (prod_id, prod_name, prod_desc, prod_rate, prod_img, prod_prc, prod_qty, prod_stat, prod_cratedt, prod_moddt) values ('$prodid', '$prodname', '$proddesc', '$prodrate', '$prodimg', '$prodprc', '$prodqty', '$prodstat', (now()), (now()))"; $link->query($sql); All the best Keith Link to comment https://forums.phpfreaks.com/topic/168300-mysql-inser-into/#findComment-887704 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.