php - Update in SQL not working -


first of all, let me tell beginner in php & sql. so, bear me. have table 1 row , 1 column date_latest. have edit field. following code in php:-

$result = "update admin set date_latest='$dt'"; if(mysql_query($result){ echo "success"; } else {echo "oops! went wrong";} } 

the code not working. appreciated.

isn't there problem brackets?

if(mysql_query($result)){     echo "success"; } else {     echo "oops! went wrong"; } 

Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -