Tried to make a simple click counter, doesnt work. Whats wrong with my trash code?
addLike.php
<?php
$requestLikes = "SELECT Likes FROM test1";
$Likes = mysql_query($requestLikes);
$insertToLikes = "INSERT INTO test1 (Likes) VALUES (" . $Likes + 1 . ")";
mysql_query($insertToLikes);
$Likes = mysql_query($requestLikes);
?>
HTML
<button action="/DEMO/PHP/addLike.php" method="post">Yeet
</button>0
<?php
echo '<h1>' . $Likes . '</h1>';
?>
www.mySite/DEMO/PHP/addLike.php
Fatal error: Uncaught Error: Call to undefined function mysql_query() in /storage/ssd4/786/4680786/public_html/DEMO/PHP/addLike.php:4 Stack trace: #0 {main} thrown in /storage/ssd4/786/4680786/public_html/DEMO/PHP/addLike.php on line 4
and yes i have established a connection to the database EDIT: Dont mind the random "0" after the button tag