# Flash-php-mysql

**URL:** <https://forum.kirupa.com/t/flash-php-mysql/162613>\
**Category:** Uncategorized\
**Created:** [September 14, 2005, 7:08pm UTC](https://forum.kirupa.com/t/flash-php-mysql/162613 "2005-09-14T19:08:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nucleo](https://avatars.discourse-cdn.com/v4/letter/n/5fc32e/32.png) [@Nucleo](https://forum.kirupa.com/u/Nucleo)\
**Post date:** [September 14, 2005, 7:08pm UTC](https://forum.kirupa.com/t/flash-php-mysql/162613/1 "2005-09-14T19:08:52Z")

</div>

hi all (first post :D)

well, i am using the book (foundation php for flash)  
to make a registration script.

(background)  
my host upgraded their version of php and switched register globals off (no idea if this has any relevance)

right, well i followed the tutorials as far as i can, i have been using flash for a while now, and i am pretty certain that flash is sending the variables that i need it to.

here is the php script which i am using

```php
<? 
// config file 
include('common.php'); 

$link = dbConnect(); 
// search for dupe usernames 
$query = "SELECT * FROM tblMembers WHERE Username='$Username'"; 

if(!mysql_query($query)) { 
	fail("Couldn't search database for duplicates");  
	} 
// if a match was found 
	if (mysql_num_rows($query) != 0 { 

//inform flash of error and quit! 
	fail("Username $Username already registered");  
	} 
	 
//add user 
	$query = "INSERT INTO tblMembers (UserName, Password, Email, Location, Guild, Server, Class) VALUES ('$UserName', '$Password', '$Email', '$Location', '$Guild', '$Server', '$Class')"; 
	 
	if(!mysql_query($query)) { 
		fail("Username $UserName already exists"); 
		 
		//inform flash of success 
		print "&Status=Okay"; 
	//close link to db 
	mysql_close($link);	 
?>

```

i am a total newbie to php, so any insight on this would be great

at first, i thought that it would be the php which was letting me down. then my brother asked if i could finish off a shoutbox for him, (add the table and php files) followed directly from a perfect tutorial on the web. guess what, nothing is inputted into the database, just like my problem.

i am guessing that the script and tutorial are designed to work with an older version of php. :diss: soooo…

am i right, is there something i can add to make it work?

the php sends an error message back to flash if there are any problems, well, originally it was doing that, but only because i forgot to CHMOD the .php files, well, no error comes up now.
