Inserting data into a specific row of a mySql Database using PHP

Hi,

I want to send a username from flash to a php file, which then finds the row with that username and then inserts a data value into a column of that row.

How do I do this.

This is what I have so far, but it is not working!

<?php

//this line connects to the database
include_once(“connectDB.php”);

$username = $_GET[“username”];
$currcell = $_GET[“currcell”];

$query = “SELECT * FROM table WHERE username = ‘$username’”;
$result = mysql_query($query);

$num_rows = mysql_num_rows($result);

while($row = mysql_fetch_array($result))
{

mysql_query (“INSERT INTO users($row[7]) VALUES (’$currcell’)”) or die(mysql_error()); ;

}
echo “info=done”;
?>

Thanks!

to slow!

This is it solved:

$username = $_GET[“username”];
$currcell = $_GET[“currcell”];

mysql_query(“UPDATE users SET cellid=$currcell WHERE username=’$username’”);

UPDATE users SET val1 = ‘$val1’, val2 = ‘$val2’ WHERE username = ‘$username’

8 minutes between posts… Either we’re too slow to answer or your to quick to post. :smirk: