0 Users appreciate this thread.
Like button
PLMasterSSB (2013-10-20 18:57:58)Make a PHP code to tell the page, "when they click the button, update the table in my database_name database where the username I respect = $_GET['usernane']
^ Click
(This Image was created from cooltext.com)
angelrulez7 (2013-10-20 21:08:43)You need to understand how to do this.
But just a hint.
[code=Code for kevin *php]<?php
mysql_query("UPDATE status SET likes = likes + 1 WHERE id='$_GET[id]'" );
?>[/code]
2013-10-20 21:10:40
a
PLMasterSSB (2013-10-24 00:35:23)Hey angel, this guy is just like me when I first started PHP. Help him out like you did with me.
BTW, I may not be good at CSS but I am pretty good at JavaScript, PHP, and jQuery.
And I have a great idea; we can make a WHOLE new site (ofcourse im not coding the CSS). It would one of the awesomest sites.
Plus, you gotta set the variables:
$likes = $row['likes'];
$likes2 = $likes + 1;
Then run your query (example);
mysql_query("UPDATE likes SET like='$ likes2' WHERE username='$_SESSION[username]'"
2013-10-24 00:56:57
^ Click
(This Image was created from cooltext.com)
PLMasterSSB (2013-10-24 23:38:55)you can PM me for more help. no more explanation in this thread
^ Click
(This Image was created from cooltext.com)
This topic is closed, so you can not post a comment.
Back to forum: Web Programming (HTML, JS, CSS, PHP, MySQL)
New registered users today: 7
Newest registered user: ElegantVulpes
In the status table, create a column 'likes', it's type is INT, and the default is 0. Echo the row in your status, along with a link to like the status. Make the link add 1 like.