Do you own a web domain or are you using any web hosting?
They typically give you access to your own SQL databases, which you can use. Then you use PHP to insert data and retrieve data into this database.


Do you own a web domain or are you using any web hosting?
They typically give you access to your own SQL databases, which you can use. Then you use PHP to insert data and retrieve data into this database.



I mean I don't know what code to use and how to modify it to work for what I want. I do have web hosting and a domain name.



Hey JosephFTaylor,
I have adapted your PHP code so you only have to replace some variables as you can read in my comments within the code... I hope that I made no mistakes cause I havenīt tested it yet
PHP Code:<?php
if (isset($_GET["connect"]) && $_GET["connect"]==true)
{
echo "online";
exit;
}
if (isset($_GET["add"]) && $_GET["add"]==true)
{
mysql_connect("localhost", "username","password") or die ("connection failed.");
/*Replace 'localhost', 'username' and password' with your db login data*/
mysql_select_db("database") or die ("database does not exist.");
$sqlselect=mysql_query("SELECT * FROM your_table");
/*Replace 'your_table' with your table :) in the database (for example 'counter_table')*/
$my_array=mysql_fetch_array($sqlselect);
$count=$my_array['column'];
/*Replace 'column' for example with 'counter'
but then 'counter' has to exist within your table as a column*/
$new_count = $count + 1;
$sqlupdate=mysql_query("UPDATE your_table SET column = $new_count")
/*Replace variables in the line above as you did before*/
mysql_close();
echo $new_count;
}
if (isset($_GET["subtract"]) && $_GET["subtract"]==true)
{
mysql_connect("localhost", "username","password") or die ("connection failed.");
/*Replace 'localhost', 'username' and password' with your db login data*/
mysql_select_db("database") or die ("database does not exist.");
$sqlselect=mysql_query("SELECT * FROM your_table");
/*Replace 'your_table' with your table :) in the database (for example 'counter_table')*/
$my_array=mysql_fetch_array($sqlselect);
$count=$my_array['column'];
/*Replace 'column' for example with 'counter'
but then 'counter' has to exist within your table as a column*/
$new_count = $count - 1;
$sqlupdate=mysql_query("UPDATE your_table SET column = $new_count")
/*Replace variables in the line above as you did before*/
mysql_close();
echo $new_count;
}
?>



Okay, so I've made the modifications. My domain name is josephftaylor.com would I just replace localhost with that? On another note, it's not working. It's not echoing 'online' when I request 'connect'.





Sorry i made two little mistakes... i forgot ";" in two lines
The code below should work now.
The request should be as the following to get "online" back: "http://www.your-site.com/index-or-something-else.php?online=true"PHP Code:<?php
if (isset($_GET["connect"]) && $_GET["connect"]==true)
{
echo "online";
exit;
}
if (isset($_GET["add"]) && $_GET["add"]==true)
{
mysql_connect("localhost", "username","password") or die ("connection failed.");
/*Replace 'localhost', 'username' and password' with your db login data*/
mysql_select_db("database") or die ("database does not exist.");
$sqlselect=mysql_query("SELECT * FROM your_table");
/*Replace 'your_table' with your table :) in the database (for example 'counter_table')*/
$my_array=mysql_fetch_array($sqlselect);
$count=$my_array['column'];
/*Replace 'column' for example with 'counter'
but then 'counter' has to exist within your table as a column*/
$new_count = $count + 1;
$sqlupdate=mysql_query("UPDATE your_table SET column = $new_count");
/*Replace variables in the line above as you did before*/
mysql_close();
echo $new_count;
}
if (isset($_GET["subtract"]) && $_GET["subtract"]==true)
{
mysql_connect("localhost", "username","password") or die ("connection failed.");
/*Replace 'localhost', 'username' and password' with your db login data*/
mysql_select_db("database") or die ("database does not exist.");
$sqlselect=mysql_query("SELECT * FROM your_table");
/*Replace 'your_table' with your table :) in the database (for example 'counter_table')*/
$my_array=mysql_fetch_array($sqlselect);
$count=$my_array['column'];
/*Replace 'column' for example with 'counter'
but then 'counter' has to exist within your table as a column*/
$new_count = $count - 1;
$sqlupdate=mysql_query("UPDATE your_table SET column = $new_count");
/*Replace variables in the line above as you did before*/
mysql_close();
echo $new_count;
}
?>
Hi Atrox! Sorry to bump, but did you have got time to take a look at Facebook?
If the user login within the app, we could share that the user is playing the game now! invite friends, show which other friends are playing the game,....



Hey StingRay,
i havenīt found something that you were looking for (with the GET object) cause i donīt know anything about facebook and its interface...
But maybe this link will be helpful for you: https://developers.facebook.com/docs/mobile/ios/build/
But this would require manual coding in objective-C and on the weekend i will search again cause i had not enough time in the past to search for something that I have not been confronted with before.
(Hope you understand what i am trying to say, my english isnīt the best)
Hi! I've found an interesting link, Thats maybe useful: http://thinkdiff.net/facebook/php-sd...nect-tutorial/
http://net.tutsplus.com/tutorials/ph...ebook-connect/
What do you think?!?



No I've got it so the buttons work and it comes back with online, but when I press the buttons it doesn't add, it only comes back with 1 and -1