Username:
Password:
Remember me:
Register

Back to forum: Web Programming (HTML, JS, CSS, PHP, MySQL)


Search forums via Google


0 Users appreciate this thread.

Like button
Started by RealKevblast
(2013-10-18 20:24:29)
angelrulez7 (2013-10-20 00:59:09)
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.
a
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']
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]

This post has been edited one or more times, the last time was:
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]'";

This post has been edited one or more times, the last time was:
2013-10-24 00:56:57

PLMasterSSB (2013-10-24 23:38:55)
you can PM me for more help. no more explanation in this thread
 

This topic is closed, so you can not post a comment.

This topic's ID: 58353

Back to forum: Web Programming (HTML, JS, CSS, PHP, MySQL)




Total registered users: 8321
New registered users today: 7
Newest registered user: ElegantVulpes

©  Copyright 2026 3DSPlaza. All Rights Reserved