# Php+mysql help please

**URL:** <https://forum.kirupa.com/t/php-mysql-help-please/137169>\
**Category:** Uncategorized\
**Created:** [February 11, 2005, 7:45pm UTC](https://forum.kirupa.com/t/php-mysql-help-please/137169 "2005-02-11T19:45:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![imbuez](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/imbuez/32/645_2.png) [@imbuez](https://forum.kirupa.com/u/imbuez)\
**Post date:** [February 11, 2005, 7:45pm UTC](https://forum.kirupa.com/t/php-mysql-help-please/137169/1 "2005-02-11T19:45:10Z")

</div>

Im trying to create a click counter for my website, with flash, php + mysql.

The plan is to have a button with a dynamic txt field which is will show the amount of times a file has been downloaded. So i need to read and write data to my database.

i have this code on a button

```
  PHP Code:

```

```php
 clickVar = 0; 

myBtn.onRelease = function() { 
    clickVar++; 
    trace(clickVar); 
};  
                           

```

\*this is what i have in my php file

```php

<?

   $DBhost = "localhost"; // Database Server
   $DBuser = "root"; // Database User
   $DBpass = ""; // Database Pass
   $DBName = "click"; // Database Name
   
   // Connect to mySQL Server
   $DBConn = mysql_connect($DBhost,$DBuser,$DBpass) or die("Error in GuestBook Application: " . mysql_error());
   
// Select mySQL Database
   mysql_select_db($DBName, $DBConn) or die("Error in GuestBook Application: " . mysql_error());

		

	//mysql_query("UPDATE click_count SET click_count=(click_count + 1) WHERE click_id=1");
	
	//mysql_query("SELECT *FROM click_count WHERE click_id=1");
	
	

$connessione = @mysql_connect($DBhost,$DBuser,$DBpass);
$database = mysql_select_db($DBName,$connessione);

$select = "SELECT *FROM click_count WHERE click_id=1";
$result = mysql_query($select);
//$rows = mysql_num_rows($result);

while($list = mysql_fetch_array($result)){
$i++;
$id = $i;
$visitor_counter = strtoupper($list["click_count"]);

print("click_counter=$visitor_counter");
}
?>

```

Its all abit over the place, i have a database called click, with a table called click\_count.

looks like this

```php
 

CREATE TABLE `click_count` (
   `click_id` int(5) NOT NULL default '0',
   `click_count` int(10) NOT NULL default '0'
 ) TYPE=MyISAM;

```

I understand this may seem all a little jumbled up, any help would be massivly appreciated, thanks guys  
mart/.
