# Anyone know php?

**URL:** <https://forum.kirupa.com/t/anyone-know-php/164847>\
**Category:** Uncategorized\
**Created:** [October 5, 2005, 1:03pm UTC](https://forum.kirupa.com/t/anyone-know-php/164847 "2005-10-05T13:03:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![natronp](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@natronp](https://forum.kirupa.com/u/natronp)\
**Post date:** [October 5, 2005, 1:03pm UTC](https://forum.kirupa.com/t/anyone-know-php/164847/1 "2005-10-05T13:03:45Z")

</div>

i’m passing vars from flash to php and trying to edit a mysql row from the db.

anyone know php and can spot something going awry with my code here?

```php
 <? 

$editUser = $_POST['user'];
$newUser = $_POST['newuser'];
$newPass = $_POST['newpass'];

//this line includes the database connection variables 

$connection = mysql_connect('localhost', 'webby', 'twelve1970'); 
mysql_select_db("photogallery", $connection) 
or die('could not select table'); 

if(count($_POST) > 0) 
{ 
$query = 'UPDATE auth SET '; 
$query .= 'username = "' . $newUser . '",'; 
$query .= 'userpassword = "' . $newPass . '" '; 
$query .= 'WHERE username = "' . $editUser . '"'; 
 
echo 'retmessage='; 
 
if(mysql_query($query,$connection)) 
{ 
echo 'User Updated'; 
} 
else 
{ 
echo 'Update Failed'; 
} 
 
} 

?> 

```
